kyungjunlee / codemixedsentimentdetection Goto Github PK
View Code? Open in Web Editor NEWA class project for CMSC723: Code mixed sentiment detection
A class project for CMSC723: Code mixed sentiment detection
when i am trying to run this block of code:
print("-"*50)
print("Running LSTM, One Hot Embeddings, Untrainable")
config = {
"NAME": "LSTM_OneHot_Untrainable",
"N_EPOCHS": 1,
"EMB_TRAIN": False,
"N_VOCAB": len(text_field.vocab.itos),
"N_EMBED" : len(text_field.vocab.itos),
"N_HIDDEN" : 512,
"N_OUTPUT" : 3,
"N_LAYERS" : 2,
"LR": 0.001
}
model = OneHotLSTM(config)
pp.pprint(config)
print("-"*50)
run_loop(model, config)
print("-"*50)
print("END TRAINING")
print("-"*50)
print("START TESTING")
print("-"*50)
test(model, config)
print("-"*50)
print("END TESTING")
print("-"*50)
this error is showing:
--------------------------------------------------
Running LSTM, One Hot Embeddings, Untrainable
{ 'EMB_TRAIN': False,
'LR': 0.001,
'NAME': 'LSTM_OneHot_Untrainable',
'N_EMBED': 899,
'N_EPOCHS': 1,
'N_HIDDEN': 512,
'N_LAYERS': 2,
'N_OUTPUT': 3,
'N_VOCAB': 899}
--------------------------------------------------
BEGIN TRAINING
--------------------------------------------------
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-34-f17180894fb6> in <module>()
16 pp.pprint(config)
17 print("-"*50)
---> 18 run_loop(model, config)
19 print("-"*50)
20 print("END TRAINING")
4 frames
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py in cross_entropy(input, target, weight, size_average, ignore_index, reduce, reduction)
2822 if size_average is not None or reduce is not None:
2823 reduction = _Reduction.legacy_get_string(size_average, reduce)
-> 2824 return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
2825
2826
TypeError: cross_entropy_loss(): argument 'input' (position 1) must be Tensor, not tuple
Any help is appreciated and please tell the requirements for pytorch version
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.