Skip to content

Instantly share code, notes, and snippets.

@aria42
Created December 21, 2017 08:16
Show Gist options
  • Save aria42/c8a6a95718d581cf3446eac0002d13b3 to your computer and use it in GitHub Desktop.
Save aria42/c8a6a95718d581cf3446eac0002d13b3 to your computer and use it in GitHub Desktop.
aria42$ java -cp target/flare-0.1.0-SNAPSHOT-standalone.jar flare.examples.sentence_classification -n 8000 --train-file data/sentiment-train10k.txt --test-file data/sentiment-test10k.txt --embed-file data/glove.6B.300d.txt
WARNING: any? already refers to: #'clojure.core/any? in namespace: vertigo.core, being replaced by: #'vertigo.core/any?
{:train-file data/sentiment-train10k.txt, :test-file data/sentiment-test10k.txt, :embed-file data/glove.6B.300d.txt, :num-classes 2, :emb-size 300, :model-type :bilstm, :lstm-size 25, :num-data 8000}
Params ([lstm/input->gates/b [200]] [hidden->logits/W [2 50]] [lstm/input->gates/W [200 650]] [hidden->logits/b [2]])
Total # params 130302
Optimizing with flare.optimize.Adadelta
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Iteration 0
{:train-accuracy {:acc 0.788125, :n 8000}}
{:test-accuracy {:acc 0.788375, :n 8000}}
{:debug
{:perf
([:* {:forward 0.25276003536467356, :backward 0.3232865879907635}]
[:hadamard
{:forward 0.04000625183020298, :backward 0.05941440527863642}]
[:split
{:forward 0.04374605357411253, :backward 0.035330801593048924}]
[:tanh
{:forward 0.018581388720311807, :backward 0.04549223931406558}]
[:+ {:forward 0.03930140530705025, :backward 0.020943276560928384}]
[:concat
{:forward 0.03738862648383264, :backward 0.020180551433396327}]
[:sigmoid
{:forward 0.03230773467225496, :backward 0.02428156996446051}]
[:cross-entropy-loss
{:forward 0.00227029133513424, :backward 0.001059480485755678}]
[:dropout
{:forward 0.0018377132554960763, :backward 0.0012000106524441712}]
[:arg-max {:forward 6.115761834314611E-4, :backward 0.0}]
[:scale {:forward 0.0, :backward 0.0}]
[:exp {:forward 0.0, :backward 0.0}]
[:strech {:forward 0.0, :backward 0.0}]
[:max {:forward 0.0, :backward 0.0}]
[:squeeze {:forward 0.0, :backward 0.0}]
[:sum-elems {:forward 0.0, :backward 0.0}])}}
End of iteration 0: 4601.384 (106398 ms)
Iteration 1
{:train-accuracy {:acc 0.8375, :n 8000}}
{:test-accuracy {:acc 0.836, :n 8000}}
{:debug
{:perf
([:* {:forward 0.25247586261524385, :backward 0.326202687777677}]
[:hadamard
{:forward 0.040644645238200924, :backward 0.058774567786338265}]
[:split
{:forward 0.044424885109332395, :backward 0.03578927378398145}]
[:tanh
{:forward 0.01879003609184813, :backward 0.043825689825961855}]
[:+ {:forward 0.03948931183565971, :backward 0.020457889730149757}]
[:concat
{:forward 0.037465229386750336, :backward 0.020049816650543104}]
[:sigmoid
{:forward 0.03172453582021576, :backward 0.024436589653241608}]
[:dropout
{:forward 0.0015557531395118671, :backward 0.0010364438271516607}]
[:cross-entropy-loss
{:forward 0.0015808052609516752, :backward 8.523251596532043E-4}]
[:arg-max {:forward 4.23651307587458E-4, :backward 0.0}]
[:scale {:forward 0.0, :backward 0.0}]
[:exp {:forward 0.0, :backward 0.0}]
[:strech {:forward 0.0, :backward 0.0}]
[:max {:forward 0.0, :backward 0.0}]
[:squeeze {:forward 0.0, :backward 0.0}]
[:sum-elems {:forward 0.0, :backward 0.0}])}}
End of iteration 1: 3726.919 (94995 ms)
Iteration 2
{:train-accuracy {:acc 0.873625, :n 8000}}
{:test-accuracy {:acc 0.867, :n 8000}}
{:debug
{:perf
([:* {:forward 0.2493750403989242, :backward 0.3320019893475722}]
[:hadamard
{:forward 0.04041993532937791, :backward 0.05880611598566921}]
[:split
{:forward 0.04420051750312462, :backward 0.036204955027330114}]
[:tanh
{:forward 0.018623604177286104, :backward 0.043232445050800546}]
[:+ {:forward 0.039087171852858704, :backward 0.02011668402096052}]
[:concat
{:forward 0.03718258069423157, :backward 0.020228524701956217}]
[:sigmoid
{:forward 0.031079323167692997, :backward 0.024527272675943613}]
[:dropout
{:forward 0.0014645430215067532, :backward 9.863554722507563E-4}]
[:cross-entropy-loss
{:forward 0.0013352543576683256, :backward 7.794755170159763E-4}]
[:arg-max {:forward 3.482116978296718E-4, :backward 0.0}]
[:scale {:forward 0.0, :backward 0.0}]
[:exp {:forward 0.0, :backward 0.0}]
[:strech {:forward 0.0, :backward 0.0}]
[:max {:forward 0.0, :backward 0.0}]
[:squeeze {:forward 0.0, :backward 0.0}]
[:sum-elems {:forward 0.0, :backward 0.0}])}}
End of iteration 2: 3148.025 (95908 ms)
Iteration 3
{:train-accuracy {:acc 0.91125, :n 8000}}
{:test-accuracy {:acc 0.9025, :n 8000}}
{:debug
{:perf
([:* {:forward 0.2539154343084556, :backward 0.3295966022141497}]
[:hadamard
{:forward 0.040737443508106035, :backward 0.05785249012840965}]
[:split
{:forward 0.04418102810204973, :backward 0.035807281910301594}]
[:tanh
{:forward 0.018836547935714747, :backward 0.04250253088101443}]
[:+ {:forward 0.03946413986825841, :backward 0.019705011577857853}]
[:concat
{:forward 0.03712710948232964, :backward 0.020076714030445166}]
[:sigmoid
{:forward 0.031339597285347735, :backward 0.02426974331273495}]
[:dropout
{:forward 0.001398403420201497, :backward 9.492031972080186E-4}]
[:cross-entropy-loss
{:forward 0.0011930503228573986, :backward 7.321655684199378E-4}]
[:arg-max {:forward 3.155029461378938E-4, :backward 0.0}]
[:scale {:forward 0.0, :backward 0.0}]
[:exp {:forward 0.0, :backward 0.0}]
[:strech {:forward 0.0, :backward 0.0}]
[:max {:forward 0.0, :backward 0.0}]
[:squeeze {:forward 0.0, :backward 0.0}]
[:sum-elems {:forward 0.0, :backward 0.0}])}}
End of iteration 3: 2508.897 (100876 ms)
Iteration 4
{:train-accuracy {:acc 0.928375, :n 8000}}
{:test-accuracy {:acc 0.91775, :n 8000}}
{:debug
{:perf
([:* {:forward 0.25405160150835454, :backward 0.329426570614772}]
[:hadamard
{:forward 0.040988384126431555, :backward 0.057544185301513784}]
[:split
{:forward 0.04454343803684255, :backward 0.0357440646404109}]
[:tanh
{:forward 0.018898271849615754, :backward 0.04220183618163326}]
[:+ {:forward 0.039681089889487785, :backward 0.019525703858963343}]
[:concat
{:forward 0.037387178036578046, :backward 0.019989485199627066}]
[:sigmoid
{:forward 0.03132234471078953, :backward 0.024282298290792363}]
[:dropout
{:forward 0.0013677695815545341, :backward 9.28412435410877E-4}]
[:cross-entropy-loss
{:forward 0.0011142092725113224, :backward 7.07523212793194E-4}]
[:arg-max {:forward 2.9563325191757654E-4, :backward 0.0}]
[:scale {:forward 0.0, :backward 0.0}]
[:exp {:forward 0.0, :backward 0.0}]
[:strech {:forward 0.0, :backward 0.0}]
[:max {:forward 0.0, :backward 0.0}]
[:squeeze {:forward 0.0, :backward 0.0}]
[:sum-elems {:forward 0.0, :backward 0.0}])}}
End of iteration 4: 1941.273 (97336 ms)
Iteration 5
{:train-accuracy {:acc 0.967875, :n 8000}}
{:test-accuracy {:acc 0.95375, :n 8000}}
{:debug
{:perf
([:* {:forward 0.25272478256664166, :backward 0.3316472740060681}]
[:hadamard
{:forward 0.04096096057915625, :backward 0.05764957215676815}]
[:split
{:forward 0.04429924643993391, :backward 0.03582362231478209}]
[:tanh
{:forward 0.018803558904153587, :backward 0.04203208447777565}]
[:+ {:forward 0.039500857968158616, :backward 0.01951449697957154}]
[:concat
{:forward 0.03717168076143126, :backward 0.0201194933951683}]
[:sigmoid
{:forward 0.031070282344881784, :backward 0.024365233037466235}]
[:dropout
{:forward 0.0013532934197455174, :backward 9.22134116629511E-4}]
[:cross-entropy-loss
{:forward 0.0010664504180165142, :backward 6.956599351924005E-4}]
[:arg-max {:forward 2.7931617845898657E-4, :backward 0.0}]
[:scale {:forward 0.0, :backward 0.0}]
[:exp {:forward 0.0, :backward 0.0}]
[:strech {:forward 0.0, :backward 0.0}]
[:max {:forward 0.0, :backward 0.0}]
[:squeeze {:forward 0.0, :backward 0.0}]
[:sum-elems {:forward 0.0, :backward 0.0}])}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment