Comments (3)
Hi vinhqdang,
cuda_functional is only required when you want to use SRU instead of LSTM. I modified model.py
so that you don't have to from cuda_functional import SRU
when you use LSTM. (I simply moved the location of from cuda_functional import SRU
like this:
.
class RNNPredictor(nn.Module):
"""Container module with an encoder, a recurrent module, and a decoder."""
def __init__(self, rnn_type, enc_inp_size, rnn_inp_size, rnn_hid_size, dec_out_size, nlayers, dropout=0.5,
tie_weights=False,res_connection=False):
super(RNNPredictor, self).__init__()
self.enc_input_size = enc_inp_size
self.drop = nn.Dropout(dropout)
self.encoder = nn.Linear(enc_inp_size, rnn_inp_size)
if rnn_type in ['LSTM', 'GRU']:
self.rnn = getattr(nn, rnn_type)(rnn_inp_size, rnn_hid_size, nlayers, dropout=dropout)
elif rnn_type == 'SRU':
from cuda_functional import SRU
self.rnn = SRU(input_size=rnn_inp_size,hidden_size=rnn_hid_size,num_layers=nlayers,dropout=dropout,
use_tanh=False,use_selu=True,layer_norm=True)
else:
'''
from rnn-time-series-anomaly-detection.
Attempting to run the code on cpu with LSTM default;
python 1_train_predictor.py --data nyc_taxi --filename nyc_taxi.pkl --device cpu
I've run this model successfully on the GPU but when switching to CPU I have the following error.
RuntimeError: invalid argument 2: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Call .contiguous() before .view(). at /pytorch/aten/src/TH/generic/THTensor.cpp:237
from rnn-time-series-anomaly-detection.
from rnn-time-series-anomaly-detection.
Related Issues (20)
- loss function
- [BUG]: Model saving logic is wrong HOT 1
- [BUG]: Computing normal stats is wrong
- UnicodeDecodeError on Windows10 HOT 3
- RuntimeError: view size is not compatible with input tensor's size and stride HOT 2
- Training on Custom Dataset
- Operation does not have an identity.
- What if you have taxi data from multiple states?
- repackage_hidden의 역할이 뭔가요? HOT 1
- The program is stuck when running SRU, there is no prompt message
- error changes HOT 1
- Runtime error running example HOT 3
- resume problem
- RuntimeError when using tie_weights=True
- Labels of the datasets HOT 1
- paper
- 调通代码
- what data augmentation method you use?
- A question about the size of the rnn input emb in function forward HOT 1
- `chfdb_chf14_45590.pkl` file isn't found
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 rnn-time-series-anomaly-detection.