-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MLP surrogate support #68
Conversation
self.fail(f'Import failed: {e}') | ||
|
||
def test_initialization(self): | ||
# Check if the NNClassifier is initialized correctly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was incorrect initialization an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better safe than sorry
loss_grad_fn = jax.value_and_grad(self.forward_loss) | ||
self.ncl = len(jnp.unique(X)) | ||
X = jax.nn.one_hot(X, num_classes=self.ncl).reshape(X.shape[0], -1) | ||
sample_batch = jnp.ones((1, X.shape[1])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test perf with other initializers? Not sure how well that behaves with a hardcoded PRNGKey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't and it doesn't matter for a somewhat ok space of categorical problems we're considering here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
To go beyond linear surrogates, mlp models are supported.