Closed codenameAggie closed 4 years ago
Dear Arash,
I see that you are posting a few questions, which is good. However, it is difficult for us to help you with the way you are formulating your questions... What you should do is:
Howdy!
I am so sorry! This is my first time posting on GitHub, and I didn't even know it was markdown enabled until I posted it! :)
I am working on formulating the problem in a smaller scale and will post it soon.
Thank you, Arash
Howdy!
This issue was solved via the last post, "Problem With Interpolate".
Thank you, Arash
Howdy!
I am trying to run the tutorial as it is on the docs, and I get the following:
from pygsp import graphs, plotting 2 import numpy as np 3 4 G = graphs.Sensor(N=256, seed=42) 5 G.compute_fourier_basis() 6
Create label signal
7 label_signal = np.copysign(np.ones(G.N), G.U[:, 3]) 8 1 G.plot_signal(label_signal) (<Figure size 432x288 with 2 Axes>, <matplotlib.axes._subplots.AxesSubplot at 0x1e2feb61780>)
1 rs = np.random.RandomState(42) 2
Create the mask
3 M = rs.rand(G.N) 4 M = (M > 0.6).astype(float) # Probability of having no label on a vertex. 5
Applying the mask to the data
6 sigma = 0.1 7 subsampled_noisy_label_signal = M (label_signal + sigma rs.standard_normal(G.N)) 8 G.plot_signal(subsampled_noisy_label_signal) (<Figure size 432x288 with 2 Axes>, <matplotlib.axes._subplots.AxesSubplot at 0x1e2fee9a400>)
1 import pyunlocbox 2
Set the functions in the problem
3 gamma = 3.0 4 d = pyunlocbox.functions.dummy() 5 r = pyunlocbox.functions.norm_l1() 6 f = pyunlocbox.functions.norm_l2(w=M, y=subsampled_noisy_labelsignal, 7 lambda=gamma) 8
Define the solver
9 G.compute_differential_operator() 10 L = G.D.toarray() 11 step = 0.999 / (1 + np.linalg.norm(L)) 12 solver = pyunlocbox.solvers.mlfbf(L=L, step=step) 13
Solve the problem
14 x0 = subsampled_noisy_label_signal.copy() 15 prob1 = pyunlocbox.solvers.solve([d, r, f], solver=solver, x0=x0, rtol=0, maxit=1000) 16
17 G.plot_signal(prob1['sol'])
ValueError Traceback (most recent call last)