Skip to content

Commit

Permalink
Refactor code to initialize evaluation dictionary with ones for evalu…
Browse files Browse the repository at this point in the history
…ation array
  • Loading branch information
fullbat committed Nov 3, 2024
1 parent 21e26ba commit 7e39e8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 6 additions & 1 deletion commit/core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,11 @@ cdef class Evaluation :
logger.subinfo('')
logger.info( 'Building linear operator A' )

nF = self.DICTIONARY['IC']['nF'] # number of FIBERS
n2 = nF * self.KERNELS['wmr'].shape[0]

self.DICTIONARY["IC"]["eval"] = np.ones( int(n2), dtype=np.uint32)

self.A = operator.LinearOperator( self.DICTIONARY, self.KERNELS, self.THREADS, True if hasattr(self.model, 'nolut') else False )

logger.info( f'[ {format_time(time.time() - tic)} ]' )
Expand Down Expand Up @@ -1216,7 +1221,7 @@ cdef class Evaluation :
logger.info( f'[ {format_time(time.time() - tr)} ]' )


def fit( self, tol_fun=1e-3, tol_x=1e-6, max_iter=100, x0=None, confidence_map_filename=None, confidence_map_rescale=False, debias=True ) :
def fit( self, tol_fun=1e-3, tol_x=1e-6, max_iter=100, x0=None, confidence_map_filename=None, confidence_map_rescale=False, debias=False ) :
"""Fit the model to the data.
Parameters
Expand Down
3 changes: 0 additions & 3 deletions commit/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,6 @@ def fista(y, A, At, omega, prox, sqrt_W=None, tol_fun=1e-4, tol_x=1e-6, max_iter
else:
res = A.dot(xhat) - y
grad = np.asarray(At.dot(res))

print("grad", grad[grad!=0][:50])
print("res", res[res!=0][:50])

prox( xhat, 1.0 )
reg_term = omega( xhat )
Expand Down

0 comments on commit 7e39e8c

Please sign in to comment.