Fix problem related to param "axis" in Transformer class #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greetings,
I'm proposing a pull request to fix a tiny bug I have found. I'll try to provide as much information as possible in the next of the message:
1. What I want to do
I am trying to implement an NN using transformer layers as a time encoder using the class Transformer
from tsl.nn.blocks.encoders import Transformer
.2. What is the problem?
if a set the param
axis='time'
as is established in documentation I obtain the next error:File "/home/javier/anaconda3/envs/tsl/lib/python3.10/site-packages/tsl/nn/blocks/encoders/transformer.py", line 193, in __init__ transformer_layer(
File "/home/javier/anaconda3/envs/tsl/lib/python3.10/site-packages/tsl/nn/blocks/encoders/transformer.py", line 43, in __init__ self.att = MultiHeadAttention(embed_dim=hidden_size,
File "/home/javier/anaconda3/envs/tsl/lib/python3.10/site-packages/tsl/nn/layers/base/attention.py", line 135, in __init__ raise ValueError("Axis can either be 'steps' (0) or 'nodes' (1), "
ValueError: Axis can either be 'steps' (0) or 'nodes' (1), not 'time'.
What is the source of the problem?
Checking the code of the code of the class Transformer this can be found:
However, this is the code of the class MultiHeadAttention:
Which solution do I propose?
I want to change this pull request to update the references to steps in MultiHeadAttention class to time.
Final warning
I have tried to run the tests, but I couldn't because of some problems in my python installation. However, I expect this minor change to be suitable for all tests.