clab / dynet_tutorial_examples Goto Github PK
View Code? Open in Web Editor NEWTutorial on "Practical Neural Networks for NLP: From Theory to Code" at EMNLP 2016
Tutorial on "Practical Neural Networks for NLP: From Theory to Code" at EMNLP 2016
with
--- a/tutorial_rnnlm.py
+++ b/tutorial_rnnlm.py
@@ -6,8 +6,8 @@ import dynet as dy
import numpy as np
-train_file="CHAR_TRAIN"
-test_file="CHAR_DEV"
+train_file=r"data/small-train.txt"
+test_file=r"data/small-test.txt"
I run:
rzai@rzai00:/prj/dynet_tutorial_examples$ python tutorial_rnnlm.py/prj/dynet_tutorial_examples$
[dynet] random seed: 3680189036
[dynet] allocating memory: 512MB
[dynet] memory allocation done.
[epoch=0 eta=0.001 clips=499 updates=499] 3.59679303528
[epoch=0 eta=0.001 clips=500 updates=500] 2.90541985253
[epoch=0 eta=0.001 clips=500 updates=500] 2.82589651857
[epoch=0 eta=0.001 clips=500 updates=500] 2.78318269468
[epoch=0 eta=0.001 clips=500 updates=500] 2.7271153855
[epoch=0 eta=0.001 clips=500 updates=500] 2.71135471952
[epoch=0 eta=0.001 clips=500 updates=500] 2.67784155937
[epoch=0 eta=0.001 clips=500 updates=500] 2.67465448101
[epoch=0 eta=0.001 clips=500 updates=500] 2.6514647308
[epoch=0 eta=0.001 clips=500 updates=500] 2.63369510998
[epoch=0 eta=0.001 clips=500 updates=500] 2.61760151217
[epoch=0 eta=0.001 clips=500 updates=500] 2.60906285933
[epoch=0 eta=0.001 clips=500 updates=500] 2.58898071744
[epoch=0 eta=0.001 clips=500 updates=500] 2.5481264534
[epoch=0 eta=0.001 clips=500 updates=500] 2.55303348667
[epoch=0 eta=0.001 clips=500 updates=500] 2.54707865508
[epoch=0 eta=0.001 clips=500 updates=500] 2.53384964483
[epoch=0 eta=0.001 clips=500 updates=500] 2.5381710203
[epoch=0 eta=0.001 clips=500 updates=500] 2.63992879771
Traceback (most recent call last):
File "tutorial_rnnlm.py", line 107, in
loss_exp = calc_lm_loss(sent)
File "tutorial_rnnlm.py", line 78, in calc_lm_loss
wids = [vw.w2i[w] for w in sent]
KeyError: 'closure'
rzai@rzai00:
When I pasted all the contents into a single Python file and run the following:
python parser.py --dynet-gpus 1 --dynet-mem 10000
It throws the following Not Implemented error:
[dynet] initializing CUDA
Request for 1 GPU ...
[dynet] Device Number: 0
[dynet] Device name: Tesla K80
[dynet] Memory Clock Rate (KHz): 2505000
[dynet] Memory Bus Width (bits): 384
[dynet] Peak Memory Bandwidth (GB/s): 240.48
[dynet] Memory Free (GB): 11.927/11.9956
[dynet]
[dynet] Device(s) selected: 0
[dynet] random seed: 3589591803
[dynet] allocating memory: 10000MB
[dynet] memory allocation done.
Traceback (most recent call last):
File "parser.py", line 206, in <module>
dev_loss += loss.scalar_value()
File "_gdynet.pyx", line 947, in _gdynet.Expression.scalar_value (_gdynet.cpp:23604)
cpdef scalar_value(self, recalculate=False):
File "_gdynet.pyx", line 960, in _gdynet.Expression.scalar_value (_gdynet.cpp:23509)
return c_as_scalar(self.cgp().get_value(self.vindex))
RuntimeError: RestrictedLogSoftmax not yet implemented for CUDA (contributions welcome!)
Does that mean this notebook can only run on CPU for now?
rzai@rzai00:/prj/dynet_tutorial_examples$ python tutorial_rnnlm_minibatch.py/prj/dynet_tutorial_examples$
[dynet] random seed: 1792663534
[dynet] allocating memory: 512MB
[dynet] memory allocation done.
Traceback (most recent call last):
File "tutorial_rnnlm_minibatch.py", line 39, in
train=list(read(train_file))
File "tutorial_rnnlm_minibatch.py", line 33, in read
with file(fname) as fh:
IOError: [Errno 2] No such file or directory: 'CHAR_TRAIN'
rzai@rzai00:
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.