Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

MLP surrogate support #68

wants to merge 3 commits into from

Conversation

SkBlaz
Copy link
Collaborator

@SkBlaz SkBlaz commented May 13, 2024

To go beyond linear surrogates, mlp models are supported.

self.fail(f'Import failed: {e}')

def test_initialization(self):
# Check if the NNClassifier is initialized correctly

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?

Copy link
Collaborator Author

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]))

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.

Copy link
Collaborator Author

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.

@SkBlaz SkBlaz requested review from bmramor and adischw May 15, 2024 08:32
@SkBlaz SkBlaz assigned SkBlaz and unassigned bmramor and miha-jenko May 15, 2024
@SkBlaz SkBlaz requested a review from mihajenko May 17, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants