Questions tagged [trax]

For questions related to the Trax deep learning framework

Trax is an end-to-end library for deep learning that focuses on clear code and speed. It is actively used and maintained by the Google Brain team.

29 questions
0
votes
0 answers

I Am not able to import trax library in jupyter notebook

import os import nltk import trax from trax import layers as tl from trax.fastmath import numpy as fastnp Error: ValueError Traceback (most recent call last) Cell In[1], line 3 1 import os 2 import…
0
votes
0 answers

Trax -> AttributeError: 'list' object has no attribute 'rng'

I am new to Trax and am trying to code a transformer using it. When I try to run the training loop, it shows the error: --------------------------------------------------------------------------- AttributeError Traceback…
0
votes
0 answers

Trax training loop stops after 1 epoch even after setting n_steps to 10

https://colab.research.google.com/drive/1Vfc5i2NkqHdCHwnOHRFP7nr40y2kRA3_?usp=sharing Please run the linked notebook. My trax training loop stops after 1 epoch without any error messages. Please advice where am I making a mistake. Relevant Code…
Rahuketu86
  • 475
  • 2
  • 6
  • 17
0
votes
0 answers

Why is trax tl.ShiftRight appied only if the mode is not 'eval'?

In Trax doc for trax.layers.attention.ShiftRight(https://trax-ml.readthedocs.io/en/latest/trax.layers.html?highlight=tl.ShiftRight#trax.layers.attention.ShiftRight), it says "Applies only if layer is created in a non-'eval' mode." There are three…
0
votes
1 answer

What is the difference between Parallel and Branch combinators in Trax?

I don't understand what's the difference between the Branch and the Parallel combinators. They both seem to apply a list of layers in parallel, the only difference is that Branch applies them to copies of inputs -- what does that mean?
mrbuttonsmeow
  • 127
  • 1
  • 5
0
votes
0 answers

How to use trax to evaluate accuracy with all samples in EvalTask at each checkpoint?

I am in the process of learning trax. I would like to implement a simple MLP in trax, so I translated the tensorflow version of the "MLP for Multiclass Classification" code…
ymc
  • 77
  • 3
0
votes
1 answer

MaxPooling 1D layer in Trax

How can I code my own MaxPooling_1D layer in google Trax? I understand that current max pooling is based on 2D max pooling. Here's how I tried using Keras 1d layer import trax.layers as tl def computePool(max_pool_1d,in_tensor): …
0
votes
1 answer

Reimplementing bert-style pooler throws shape error as if length-dimension were still needed

I have trained an off-the-shelf Transformer(). Now I want to use the encoder in order to build a classifier. For that I want to only use the first token's output (bert-style cls-token-result) and run that through a dense layer. What I…
Phillip Bock
  • 1,879
  • 14
  • 23
0
votes
1 answer

Is the module trax.fastmath deprecated?

Is the module trax.fastmath of TRAX package deprecated? I am using this module, but ModuleNotFoundError is returned.
Nanda
  • 361
  • 1
  • 5
  • 14
0
votes
1 answer

module 'trax.supervised' has no attribute 'inputs'

I am working on a project involving Google's TRAX package. I encountered the following error message while running a snippet of code on Jupyter notebook. module 'trax.supervised' has no attribute 'inputs' Is there a way around this issue? I have…
Nanda
  • 361
  • 1
  • 5
  • 14
0
votes
2 answers

What is *.subwords file in natural language processing to use as vocabulary file?

I have been trying to create a vocab file in a nlp task to use in tokenize method of trax to tokenize the word but i can't find which module/library to use to create the *.subwords file. Please help me out?
0
votes
1 answer

Select task from Trax loop

I have a Trax loop object, from which I would like to extract a task object. The code below returns the error AttributeError: 'Loop' object has no attribute '_task'. Do you have suggestions on how to fix this? Background info: I am trying to run on…
albus_c
  • 6,292
  • 14
  • 36
  • 77
0
votes
1 answer

AttentionQKV from Trax

The AttentionQKV layer implemented by Trax is as the following: AttentionQKV def AttentionQKV(d_feature, n_heads=1, dropout=0.0, mode='train'): """Returns a layer that maps (q, k, v, mask) to (activations, mask). See `Attention` above for…
Charles Ju
  • 1,095
  • 1
  • 9
  • 28
1
2