-
Notifications
You must be signed in to change notification settings - Fork 118
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
Adding: Numpy Backend #483
Conversation
…as-core into aritra-np-backend OK
Todos:
|
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.
Thanks for the PR!
I suppose if we're going to add Numpy as a backend we should also add CI for it -- this just means we'll need to add numpy
to the backend list in actions.yaml
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.
Great work! 👍
def fit(self): | ||
raise NotImplementedError("Trainer not implemented for NumPy backend.") | ||
|
||
def predict(self): |
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.
Long term it could be possible to implement predict and evaluate.
@@ -49,3 +49,11 @@ def __getattr__(self, name): | |||
from keras_core.backend import torch as torch_backend | |||
|
|||
return getattr(torch_backend, name) | |||
if self._backend == "numpy": | |||
# TODO (ariG23498): | |||
# The import `from keras_core.backend import numpy as numpy_backend` |
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.
Why is this the case?
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.
I am usure about this. It might have to do with numpy
backend having a numpy
file on its own (which somehow creates the error).
Please run |
I am usure why the JAX tests fail. |
Are you able to run them locally? They're timing out rather than failing. This is possibly normal. |
Yep! Tried running the test suite with JAX and it ran fine. |
Removed the debug statements! Sorry about that 😅 |
I think we should be good to merge. Thanks for the great contribution! |
* chore: adding numpy backend * creview comments * review comments * chore: adding math * chore: adding random module * chore: adding ranndom in init * review comments * chore: adding numpy and nn for numpy backend * chore: adding generic pool, max, and average pool * chore: adding the conv ops * chore: reformat code and using jax for conv and pool * chore: added self value * chore: activation tests pass * chore: adding post build method * chore: adding necessaity methods to the numpy trainer * chore: fixing utils test * chore: fixing losses test suite * chore: fix backend tests * chore: fixing initializers test * chore: fixing accuracy metrics test * chore: fixing ops test * chore: review comments * chore: init with image and fixing random tests * chore: skipping random seed set for numpy backend * chore: adding single resize image method * chore: skipping tests for applications and layers * chore: skipping tests for models * chore: skipping testsor saving * chore: skipping tests for trainers * chore:ixing one hot * chore: fixing vmap in numpy and metrics test * chore: adding a wrapper to numpy sum, started fixing layer tests * fix: is_tensor now accepts numpy scalars * chore: adding draw seed * fix: warn message for numpy masking * fix: checking whether kernel are tensors * chore: adding rnn * chore: adding dynamic backend for numpy * fix: axis cannot be None for normalize * chore: adding jax resize for numpy image * chore: adding rnn implementation in numpy * chore: using pytest fixtures * change: numpy import string * chore: review comments * chore: adding numpy to backend list of github actions * chore: remove debug print statements
In this PR I will continue working on the Numpy Backend for Keras Core