Description
There have been multiple requests for a tool to convert nnet2 models into nnet3 models.
There is no such tool currently available. However it would be simple to write and does not even need accessing the C++ parts of the nnet2 or nnet3 code.
The procedure is
- Convert nnet2 model to text format using nnet-am-copy
- Isolate the parameter matrices corresponding to components (e.g.
NaturalGradientAffineComponent
) into separate files - Use these files to initialize the components in the nnet3 model using the
file-name
argument in the config string. For this write a nnet3 config which replicates the nnet2 model architecture andnnet3-am-init
to initialize this model and write it out.
This would be a simple python script involving some string parsing.