@@ -69,4 +69,39 @@ This will:
6969
7070# # Basic example
7171
72+ Suppose we are given a matrix $A \i n \m athbf{R}^{m \t imes n}$.
73+ Consider the following nonnegative matrix factorization problem:
74+
75+ $$
76+ \b egin{array}{ll}
77+ \t ext{minimize} & {\| XY + Z - A\| }_F\\
78+ \t ext{subject to} & X_{ij} \g eq 0,\q uad i = 1, \l dots, m,
79+ \q uad j = 1, \l dots, k\\
80+ & Y_{ij} \g eq 0,\q uad i = 1, \l dots, k,\q uad j = 1, \l dots, n\\
81+ & {\| Z\| }_F \l eq 1,
82+ \e nd{array}
83+ $$
84+
85+ with variables $X \i n \m athbf{R}^{m \t imes k}$,
86+ $Y \i n \m athbf{R}^{k \t imes n}$,
87+ and $Z \i n \m athbf{R}^{m \t imes n}$.
88+
89+ To specify and solve this problem using ` dbcp` ,
90+ one may use the following code:
91+
92+ ` ` ` python
93+ import cvxpy as cp
94+ import dbcp
95+
96+ X = cp.Variable(( m, k), nonneg= True)
97+ Y = cp.Variable((k, n), nonneg=True)
98+ Z = cp.Variable((m, n))
99+
100+ obj = cp.Minimize(cp.norm(X @ Y + Z - A, ' fro' ))
101+ constraints = [cp.norm(Z, ' fro' ) <= 1]
102+ prob = dbcp.BiconvexProblem(obj, [[X], [Y]], constraints)
103+
104+ prob.solve ()
105+ ` ` `
106+
72107# # Citation
0 commit comments