-
Notifications
You must be signed in to change notification settings - Fork 23
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
Making train_params and model_params functional to add documentation and avoid duplication #38
Comments
Probably better to have separate model_params functions per model_type because they will have different types of params e.g. DilatedConvModel won't have |
I see the reasoning for this, but is there a reason why you want to have them in a function? Wouldn't it be more simple to have a json/yaml file in a directory with models and load them directly from there and overwrite the params of the model? If you make a function then it becomes gRelu specific instead of a more generic solution. |
|
How i would do it is I would create a pydantic model for your models, this would validate your model params. If you want a function that gives said params, the function reads from a default file and spits the new params, you could add functionality that replaces some elements if you give them key value pairs, and runs the validation after to ensure the new params are correct. The nice thing of this approach is that the pydantic models can be exported and you guarantee that the params are valid. |
My two cents for what it’s worth. One very nice feature of gReLU is that is
self contained and easy to use. I worry it becomes more steps for users to
generate errors if you move, eg, to JSON files.
Sent from Gmail Mobile
…On Mon 5. Aug 2024 at 10:35, ekageyama ***@***.***> wrote:
How i would do it is I would create a pydantic model for your models, this
would validate your model params. If you want a function that gives said
params, the function reads from a default file and spits the new params,
you could add functionality that replaces some elements if you give them
key value pairs, and runs the validation after to ensure the new params are
correct. The nice thing of this approach is that the pydantic models can be
exported and you guarantee that the params are valid.
—
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACQMKU3J6IVWNMZ5EBWRMH3ZP6ZUZAVCNFSM6AAAAABL7KZGB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRZGU3TEMRYHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
In theory a new user wouldnt touch the jsons, as gocken mentioned it would be something like |
Right now it's hard to document
model_params
andtrain_params
because they are simply big dictionaries we copy from notebook to notebook, e.g.:This also makes things highly redundant. I was wondering if we can simply move these to very simple functions like
make_train_params()
andmake_model_params()
where the dictionaries above are the default arguments and they simply return these dictionaries. They can be overwritten by the user and should have docstrings just like other functions. That'd solve both the lack of documentation problem and the redundancy problem.Final thing would look like:
Let me know if this makes sense.
The text was updated successfully, but these errors were encountered: