GateNLP / gate-lf-pytorch-json

PyTorch wrapper for the LearningFramework GATE plugin
Apache License 2.0
1 stars 2 forks source link

Unique identifier for every layer we create #3

Open johann-petrak opened 6 years ago

johann-petrak commented 6 years ago

Every layer that gets created should get a unique name which shows up on the printout of the network. This name should then be used for retrieving the configuration from the modelwrapper initialisation parameter. This parameter could be a dictionary which contains one entry per name, which in turn is a dictionary of settings. E.g. for the layer called "lstm" we may have {lstm:{hidden:200, bidirectional:True}}

johann-petrak commented 6 years ago

This is partly implemented, but cannot be done with the standard pytorch API in all cases, because the identifier is a property of the containing module, not the module itself. Also, there are limits to what the name can be, because it has to be a valid python identifier. For now we manipulate the container and encode the name to make it an identifier.