returnn icon indicating copy to clipboard operation
returnn copied to clipboard

Extension of `base:` syntax with link to root

Open Atticus1806 opened this issue 4 years ago • 2 comments

When working with subnetworks there are quite a few situations, where it would be more simple and easier to read to access the layers beginning from root instead of always going into the previous parent layer with base. So for example instead of writing base:base:base:base:encoder to access a layer called encoder on the root level of the network use root:encoder . Would it be possible to extend RETURNN in such a way? I heard it is planned to remove the from parameter from subnetworks or to at least make it not "common style" to use it, so I thought this might be a good addition to keep the configs clean.

Atticus1806 avatar May 25 '21 16:05 Atticus1806

Yea, ok. Feel free to create a PR.

Do you have suggestions for the prefix? root:?

I heard it is planned to remove the from parameter from subnetworks or to at least make it not "common style" to use it

I guess you refer to discussions in #506 and #507. No, this is not quite right. The idea was to replace it by sth which makes it less ambiguous, more explicit. (Let's not discuss this here. See #530 and #531.)

albertz avatar May 25 '21 17:05 albertz

To implement this, you basically would search for all current "base:" prefix logic we currently have anywhere in RETURNN, and would add such "root:" prefix logic accordingly.

There are probably multiple such cases, due to different cases in RecLayer, SubnetworkLayer, and maybe other cases.

albertz avatar Oct 06 '21 14:10 albertz