New answers tagged

0

Till now, what I have learned is that it is a trial and error process. And the best solution is to look for projects that have already done this using a working combination of libraries. I used this requirements.txt file, which works fine: gunicorn flask numpy https://download.pytorch.org/whl/cpu/torch-1.1.0-cp36-cp36m-linux_x86_64.whl torchvision==0.2.2 ...


0

Bidrectional LSTMs are still traditional and so I believe you refer to unidirectional LSTM models. Concept Unidirectional LSTM layers only preserve information of the past, as inputs are processed at each time point in a sequential forward pass. This means that, at each time-point the sequence model only reads information from the past. However bidirectional ...


0

If you are open to using huggingface transformer for fine tuning which is really popular, here is a code sample: import transformers class Model(nn.Module): def __init__(self): super(Model,self).__init__() self.Bert = transformers.CamemBertModel.from_pretrained('camembert-base') self.fc0 = nn.Linear(768,1) nn.init.normal_(...


1

One option is to give each model a unique identifier (e.g., a hash value or nickname). Then store all the metadata in another file. Another option is using the PyTorch torch-model-archiver feature.


0

The framing of your problem is close to so-called language modeling task. Because your input data is fixed-length samples, you can use a seq2seq model with fixed-size context embedding. What this means is you would essentially have an encoder, Bi-LSTM for example which encodes your input into a fixed representation (by concatenating the final output states ...


2

Setting stride to 0 is not necessary, torch will simply compute with respect to the input tensor sizes, so you can set stride to (1,1). For x of size (batch_size, 3, max_dim_0, max_dim_0) (square image) the tensor output will be of size (batch_size, 32, 1, max_dim_0).


0

First of all, I would like you to discourage you from using structured input in NMT. In most cases, the best thing you can do is just do some subword input and output segmentation and learn simple sequence-to-sequence conversion. You can certainly pass the parsed input in the format that you showed above and the worse thing you can expect the model will to ...


Top 50 recent answers are included