-
Notifications
You must be signed in to change notification settings - Fork 21
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
Saving and Loading Objax EMLPs yields slightly different predictions #8
Labels
bug
Something isn't working
Comments
It looks like this is due to randomness in the bilinear layer that is not captured as objax state variables. A workaround is to use the same numpy seed when initializing the model in both cases: import emlp
from emlp.groups import SO
from emlp.reps import T,V
import numpy as np
import objax
np.random.seed(42)
net = emlp.nn.EMLP(T(1)+T(2),T(0),SO(3))
x=np.linspace(0,1,12)
print(net(x).T)
# Saving with file descriptor
with open('net.npz', 'wb') as f:
objax.io.save_var_collection(f, net.vars()) Output: [0.03251831] import emlp
from emlp.groups import S
from emlp.reps import T,V
import numpy as np
import objax
np.random.seed(42)
net = emlp.nn.EMLP(T(1)+T(2),T(0),SO(3))
x=np.linspace(0,1,12)
# Loading with file descriptor
with open('net.npz', 'rb') as f:
objax.io.load_var_collection(f, net.vars())
print(net(x).T) Output [0.03251831] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It appears loading up an EMLP models saved with
objax.io.save_var_collection
yields slightly different predictions than the original model.Output: [0.4905533]
Output [0.4904544]
The text was updated successfully, but these errors were encountered: