NVIDIA / OpenSeq2Seq

Toolkit for efficient experimentation with Speech Recognition, Text2Speech and NLP
https://nvidia.github.io/OpenSeq2Seq
Apache License 2.0
1.54k stars 369 forks source link

Adding custom hooks #381

Closed w4-anthony closed 5 years ago

w4-anthony commented 5 years ago

I would like to have the ability to add a custom hook through the configuration file. Is that a feature that would be desirable? If so, I could work on a PR for that.

borisgin commented 5 years ago

Hi, can you give some example how you would use such hooks, please?

w4-anthony commented 5 years ago

Hi Boris, The idea would be to define a hook in the train_params dictionary in your config file. Something like:

train_params = { "data_layer": ... ... "hooks": [MyHook] }

Where MyHook would be a class derived from tf.train.SessionRunHook and it would be passed along to the train() function in open_seq2seq/utils/funcs.py.

I'm not super familiar with OpenSeq2Seq code base yet, but it looks like it's feasible. What do you think?

borisgin commented 5 years ago

This can be useful, for example to add logging hooks. Yes, please open PR

okuchaiev commented 5 years ago

this was merged to master, closing