Skip to content

Solver satisfying Dale's principle. - #70

Open
Seanny123 wants to merge 1 commit into
masterfrom
parisien
Open

Solver satisfying Dale's principle.#70
Seanny123 wants to merge 1 commit into
masterfrom
parisien

Conversation

@Seanny123

@Seanny123 Seanny123 commented Mar 20, 2018

Copy link
Copy Markdown
Contributor

Based off the code described in this Nengo issue. Equivalent in effect to the Parisien transform, but has better performance.

Still to do:

  • The L2 regularisation is definitely being done wrong and should be fixed
  • According to @astoeckel, the nnls solver in SciPy has problems and cvxopt should be used instead, as shown in this forum post.
  • The Parisien transform should be included as well as a point of comparison.

Comment thread nengo_extras/solvers.py
class DalesL2(Dales):
"""Solves for weights subject to Dale's principle with regularisation."""

def __call__(self, A, Y, rng=None, E=None, sigma=0.):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sigma shouldn't be a parameter that's passed in here. Rather, the instance should have a reg parameter, which is then used to compute sigma using the max value in A. Just like in LstsqL2.


# assert that weights themselves are close (this is true for L2 weights)

assert np.allclose(W1, W2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to check that the signs of the weights are as requested (i.e. the correct number positive/negative).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants