-
Notifications
You must be signed in to change notification settings - Fork 30
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
Model factory #351
base: main
Are you sure you want to change the base?
Model factory #351
Conversation
…and gives shorter example when it is function
…checks that externally defined nn is suitable for environment
for more information, see https://pre-commit.ci
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 not sure I understand the if/else structure of the model factory. What happens if both a filename and nn.module instance are passed to the model factory function ?
well, technically you can do it so that you take architecture from nn.Module and from the file you can take model weights. In that case it will load weights from the file and assign them to the architecture But to be honest I am not 100% sure if it is the best way to code stuff, but the idea is that it should be flexible enough: |
Your idea is very clear and cool. What about only taking a nn module instance as input ? And providing the user with a simple pol net val net and a model factory ? So it is the user's task to build its networks the way he/she likes? |
I just added And you need to run your tests (test_torch_training.py) inside functions that start with 'test_' (previous error, which needs to be corrected). Otherwise it looks good to me. 👍 |
Possible solution to issue #286
model_factory
andmodel_factory_from_env
can take external neural network.model_factory
andmodel_factory_from_env
can load a nn from filemodel_factory
andmodel_factory_from_env
can load a checkpoint for nnmodel_factory_from_env
runs the check that the external nn satisfies requirements of the environment and model_configsAll new features are tested in
test_torch_training.py
file