-
Notifications
You must be signed in to change notification settings - Fork 141
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
[tools/circle_plus_gen] Add training parameters json loader #13012
Conversation
4a0b8db
to
b2f7e27
Compare
This comment was marked as resolved.
This comment was marked as resolved.
b2f7e27
to
5cfb90c
Compare
08bdd43
to
80e15ef
Compare
80e15ef
to
fa0d7b8
Compare
@jyoungyun I explicitly asked you to review. Since you've done similar work in this draft - #12984, I guess you could give me a practical review. |
} | ||
}, | ||
"loss": { | ||
"type": "categorical crossentropy", |
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.
(question)
Where can I get the type string?
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.
There is no document for type string rules. I'll add a document and more example files for details.
For now, you could check the allowable type string only in code level.
ONE/tools/circle_plus_gen/lib/utils.py
Line 38 in 9fe820c
['categorical crossentropy', 'categoricalcrossentropy', 'cce'], |
This PR looks good to me. But there is one concern. This tool requires a json file. And a json file contains multiple strings and arguments. I couldn't grasp json file format for this tool at a glance. I use input paramters to get hyper parameters from the draft code. The use of this draft is not very clear either. If we introduce this PR to use the json file as input to this tool, it would be better to provide a guideline for the json file format. |
I agree.
I also think it is good to extend this tool to get parameters through the input options. |
tparams: TrainParam = TrainParam.from_json(hparams_file) | ||
print("load training hyperparameters") | ||
print(tparams.dump_as_json()) |
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.
from_json()
parse json file and return TrainParam
instance.
Implementing from_json()
is main goal of this PR.
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.
We could check that it sucessfully load the json files.
$ cd tools/circle_plus_gen
$ python3 main.py example/sample_tpram.circle example/train_tparam.json
load traing hyperparameters
{
"optimizer": {
"type": "adam",
"args": {
"learningRate": 0.01,
"beta1": 0.9,
"beta2": 0.999,
"epsilon": 1e-07
}
},
"loss": {
"type": "categorical crossentropy",
"args": {
"fromLogits": true,
"reduction": "sum over batch size"
}
},
"batchSize": 32
}
This PR adds a json loader to parse a json file of training hyper parameters and construct TrainParam instance. ONE-DCO-1.0-Signed-off-by: seunghui youn <sseung.youn@samsung.com>
Co-authored-by: Jang Jiseob <ragmani0216@gmail.com>
fd9f731
to
55ba482
Compare
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.
LGTM
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.
LGTM
This PR add a json loader to parse a json file of training hyper parameters and construct TrainParam instance.
ONE-DCO-1.0-Signed-off-by: seunghui youn sseung.youn@samsung.com