CalculatedContent / WeightWatcher

The WeightWatcher tool for predicting the accuracy of Deep Neural Networks
Apache License 2.0
1.44k stars 124 forks source link

change detX constraint to use rescale_eigenvalues #297

Open charlesmartin14 opened 11 months ago

charlesmartin14 commented 11 months ago

TO make the code clearer, we should change:

def detX_constraint(evals, rescale=True):
  ...

    if rescale:
        Wnorm = np.sqrt(np.sum(evals))
        Wscale = np.sqrt(num_evals)/Wnorm 
        evals = (Wscale*Wscale)*evals

To use rescale_eigenvalues() directly


def detX_constraint(evals, rescale=True):
  ...

    if rescale:
        evals = rescale_eigenvalues(evals)