altoros tensorflow cheat sheet

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

Tens or Fl owCheatSheet About

Tens or Fl ow Tens or Fl ow™ i sanopens our c es of t war e l i br ar yf ornumer i c alc omput at i onus i ng dat aflow gr aphs .Tens or Fl ow was or i gi nal l ydevel opedf ort hepur pos esof c onduc t i ngmac hi nel ear ni nganddeep neur alnet wor ksr es ear c h,butt hes ys t em i sgener alenought obeappl i c abl ei na wi devar i et yofot herdomai nsaswel l . Skflow Sc i ki tFl ow pr ovi desas etofhi ghl evel modelc l as s est hatyouc anus et oeas i l y i nt egr at ewi t hyourexi s t i ngSc i ki t l ear n pi pel i nec ode.Sc i ki tFl ow i sas i mpl i fied i nt er f ac ef orTens or Fl ow,t ogetpeopl e s t ar t edonpr edi c t i veanal yt i c sanddat a mi ni ng.Sc i ki tFl ow hasbeenmer gedi nt o Tens or Fl ow s i nc ever s i on0. 8andnow c al l edTens or Fl ow Lear n. Ker as Ker asi sami ni mal i s t ,hi ghl ymodul ar neur alnet wor ksl i br ar y,wr i t t eni nPyt hon andc apabl eofr unni ngont opofei t her Tens or Fl ow orTheano

id(object) Ret ur nt hei dent i t yofanobj ec t .Thi si s guar ant eedt obeuni queamong s i mul t aneous l yexi s t i ngobj ec t s . import __builtin__ dir(__builtin__) Ot herbui l t i nf unc t i ons

Tens or Fl ow

dir(object) Getl i s tofobj ec tat t r i but es ( fiel ds ,f unc t i ons )

Mai ncl as s es tf.Graph() tf.Operation() tf.Tensor() tf.Session() Someus ef ulf unct i ons tf.get_default_session() tf.get_default_graph() tf.reset_default_graph() ops.reset_default_graph() tf.device(“/cpu:0”) tf.name_scope(value) tf.convert_to_tensor(value) Tens or Fl ow Opt i mi z er s GradientDescentOptimizer AdadeltaOptimizer AdagradOptimizer MomentumOptimizer AdamOptimizer FtrlOptimizer RMSPropOptimizer Reduct i on reduce_sum reduce_prod reduce_min reduce_max reduce_mean reduce_all reduce_any accumulate_n Act i vat i onf unct i ons tf.nn? r el u r el u6 el u s of t pl us s of t s i gn dr opout bi as _ add s i gmoi d t anh s i gmoi d_ c r os s _ ent r opy_ wi t h_ l ogi t s s of t max l og_ s of t max s of t max_ c r os s _ ent r opy_ wi t h_ l ogi t s s par s e_ s of t max_ c r os s _ ent r opy_ wi t h_ l ogi t s wei ght ed_ c r os s _ ent r opy_ wi t h_ l ogi t s et c .

str(object) Tr ans f or m anobj ec tt os t r i ng

Skflow

I ns t al l at i on

How t oi ns t al lnew packagei nPyt hon: pip install Exampl e:pip install requests How t oi ns t al lt ens or flow? devi c e=cpu/ gpu pyt hon_ ver s i on=cp27/ cp34 sudo pip install https://storage.googleapis.com/ tensorflow/linux/$device/tensorflow0.8.0-$python_version-none-linux_x86 _64.whl How t oi ns t al lSkflow pip install sklearn How t oi ns t al lKer as pip install keras updat e~/ . ker as / ker as . j s on-r epl ac e “ t heano”by“ t ens or flow”

Hel per s

Pyt honhel per I mpor t antf unct i ons type(object) Getobj ec tt ype help(object) Gethel pf orobj ec t( l i s tofavai l abl e met hods ,at t r i but es ,s i gnat ur esands oon)

object? Showsdoc ument at i onsaboutt heobj ec t globals() Ret ur nt hedi c t i onar yc ont ai ni ngt he c ur r ents c ope' sgl obalvar i abl es . locals() Updat eandr et ur nadi c t i onar yc ont ai ni ng t hec ur r ents c ope' sl oc alvar i abl es . Ver s i on1. 09

Mai ncl as s es Tens or Fl owCl as s i fier Tens or Fl owRegr es s or Tens or Fl owDNNCl as s i fier Tens or Fl owDNNRegr es s or Tens or Fl owLi near Cl as s i fier Tens or Fl owLi near Regr es s or Tens or Fl owRNNCl as s i fier Tens or Fl owRNNRegr es s or Gett hel at es tv er s i onat :