Comments (5)
Can you post the full dictionary of the s
layer (or however you called it) (in your new decoder)?
However, it does not work.
Can you be more specific about that? If there is some exception, post the code in a Gist or Pastebin and link it here.
I am using an older version of RETURNN.
Always check with the latest version of RETURNN. Otherwise we potentially might waste time discussing things which are already solved. (Even if this is maybe unlikely in this case, as I don't remember any related changes recently, but you never know...)
What if we want to reuse the entire rec-subnet?
This should be already possible, I think, by setting reuse_params
of the rec layer itself. However, there are a lot of problematic edge cases why this will not work. E.g. I think it expects that it finds all the needed params in the reuse_layer
and otherwise will throw an exception. Maybe we could extend it by automatically falling back to create a new var if it is not found. But this could be error prone, e.g. you might miss that it actually did not share the params but just recreated all of them. That is why I usually prefer explicitness, and not too much automatic fallbacks which could hide potential bugs.
from returnn-experiments.
Can you post the full dictionary of the s layer (or however you called it) (in your new decoder)?
s
sublayer definition is as follows:
"s": {"class": "rnn_cell", "unit": "LSTMBlock", "from": ["prev:target_embed", "prev:att"], "n_out": 1000,
"reuse_params": {"map": {
"kernel": {"reuse_layer": "base:output", "custom": (lambda reuse_layer, **kwargs: reuse_layer.params["s/rec/lstm_cell/kernel"])},
"bias": {"reuse_layer": "base:output", "custom": (lambda reuse_layer, **kwargs: reuse_layer.params["s/rec/lstm_cell/bias"])}}}
}
I tried with both kernel
and lstm_cell/kernel
as keys in map
(similarly for bias
) to make sure it is not an issue.
Can you be more specific about that? If there is some exception, post the code in a Gist or Pastebin and link it here.
I am not getting any error with my RETURNN version. It simply creates new variables required for this layer (kernel
and bias
). I also tried setting reuse_params
of new decoder to share the entire decoder. In this case, new variables are created for all the sublayers.
I am having some issues in running with the latest code, so I can't say anything with certainity there. However, I guess, the latest version will also have this issue since the issue may be associated with variable scoping. For some reason, rnn_cell
creation logic (here) does not use var_creation_scope
which reuses variable scope if parameter is shared (here).
from returnn-experiments.
Ah I see. I don't exactly remember why that was the case.
Btw, instead of RnnCellLayer
, you can also use RecLayer
now (should work fine, also inside another rec layer), and I think that uses var_creation_scope
correctly.
from returnn-experiments.
Thanks Albert. I will check as per your suggestion and follow up in case of any new issues.
from returnn-experiments.
I just noticed that you opened this issue in the wrong repo. This is about RETURNN itself, not about the experiments.
I pushed a commit which should fix this.
from returnn-experiments.
Related Issues (20)
- local attention with unidirectional lstm not converging HOT 5
- Implement a unidirectional variant of local attention HOT 10
- Loading a saved Returnn model from its .meta file HOT 16
- query regarding LM data preprocessing HOT 2
- Training Configuration for TEDLIUMv2 HOT 3
- specAugment policy and schedules HOT 3
- Question about 2020-rnn-transducer HOT 16
- 2018-asr-attention/librispeech/attention/exp3.ctc.lm.config: target 'bpe' unknown HOT 3
- Question about 2018-asr-librispeech dev = get_dataset("dev", subset=3000) HOT 2
- loss nan and cost nan while running my own corpus using librispeech sets HOT 10
- Hierarchical layer name not captured correctly
- Problem with retrieving source layer from a hierarchical definition
- Multi Stage Training
- Questions on librispeech transformer lm HOT 10
- Transducer error in GetFilteredScoreOp HOT 4
- Big files in repo HOT 5
- Git commit/push rule to not allow big files HOT 3
- Could you please provide a script that could run lsh-attention for translation? HOT 4
- Assert Error when running 2022-lsh-attention HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from returnn-experiments.