Red Data Tools -Red Chainer-

Red Data Tools -Red Chainer-

RubyKaigi 2018 RubyData WorkShop
Red Data Tools での取り組み 〜Red Chainer〜

7dd50c456191c49bdfe3dc73a94eddc2?s=128

NAITOH Jun

June 01, 2018
Tweet

Transcript

  1. Red Data Tools ʙRed Chainerʙ NAITOH Jun (@naitoh) RubyKaigi 2018

    RubyData WorkShop 1 Jun 2018
  2. Why join Red Data Tools? • Because I wanted to

    do Deep Learning at Ruby. (͓࢓ࣄͰ Deep LearningΛ΍Δͱ͖͸ pythonΛ࢖͍ͬͯ·͢ɻ) • Ruby ͷπʔϧΛ૿΍ͨ͢ΊʹPython ͷπʔϧΛҠ২͢ΔಓΛબ୒ɻ • Python ͔ΒͷҠ২Λޮ཰Α͘͢ΔͨΊʹ py2rb.py Λ࡞੒ɻ • RejectKaigi 2017 Ͱൃදͨ͠ͱ͜ΖɺRed Chainer ͷଘࡏΛ঺հ͞ΕͨͷͰ Join • https://github.com/naitoh/py2rb • See http://naitoh.hatenablog.com/entry/2018/01/27/012333
  3. Red Data ToolsͰͷऔΓ૊Έ • Red Data Tools project : “Data

    processing with Ruby.” • https://red-data-tools.github.io/ • Red Chainer (“Deep Learning Programming on Ruby” session by @hatappi on RubyKaigi 2018.) • Ruby port of Chainer 2.0. (In my task, I am porting to Ruby using py2rb.py now.) • https://github.com/red-data-tools/red-chainer/ 3FE$IBJOFS $IBJOFS QZSCQZ USBOTMBUFXJUI 1ZUIPO"45 "CTUSBDU4ZOUBY5SFF OVNQZ /VNP/"SSBZ QZUIPODPEF SVCZDPEF
  4. Red Chainer΁ͷऔΓ૊Έ • Chainer 2.0 Λ Ruby ʹϙʔςΟϯάɻ(੺ࣈ෦෼͕ࢲͷ࣮ࢪͨ͠࡞ۀ) • 0.1.0

    : mnist supportɻ • 0.1.1 : LogReport, PrintReport, ProgressBar extensionsͷ௥Ճ • 0.2.0 : Snapshot αϙʔτɻ׆ੑԽؔ਺(Sigmoid, Tanh, LeakyReLU)௥Ճɻ • ςετίʔυ(׆ੑԽؔ਺(Sigmoid, Tanh, LeakyReLU, ReLU, LogSoftmax))௥Ճ • 0.3.0 : Iris-example, CIFAR10-example, ৞ΈࠐΈ, DFloat→SFloatมߋ,ଛࣦؔ਺ (MeanSquaredError)௥Ճ • ςετίʔυ(ଛࣦؔ਺ɺbackword)௥Ճ
  5. Numo::NArray΁ͷऔΓ૊Έ • Red Chainer ͕஗͍(܇࿅͕࣌ؒ௕͍)ͷͰɺNumo::NArray Λௐࠪɻ • Numo::NArray ͱ numpy

    ͷϚΠΫϩϕϯνϚʔΫΛൺֱɺϘτϧωοΫ෦෼ Λύον࡞੒ɺߴ଎Խɻ • http://naitoh.hatenablog.com/entry/2018/06/01/120356 (RubyKaigi 2018LT) • Numo::NArrayͷόάใࠂɻ • Numo::NArray΁ͷվળཁ๬ɻ • Numo::NArray͕ྑ͘ͳΔͱ Ruby ͰػցֶशΛ͍ͨ͠ਓʹԸܙ͕͋Δɻ
  6. Red Chainer ͷ࣮૷ঢ়گ • ਂ૚ֶशʹར༻Ͱ͖Δ ؔ਺͕ଟ͘ɺ࣮૷͕௥ ͍͍͍ͭͯͳ͍ɻ • exampleΛ૿΍͍ͨ͠ •

    ରԠؔ਺Λ૿΍͍ͨ͠ • GPU(Cumo)ରԠ͍ͨ͠ $IBJOFS  3FE$IBJOFS NBTUFS උߟ BDUJWBUJPO ׆ੑԽؔ਺   3F-6  4JHNPJE MPTT ଛࣦؔ਺   4PGU.BY  ฏۉࣗ৐ޡࠩ PQUJNJ[FS ࠷దԽख๏   "EBN DPOOFDUJPO   શ݁߹ɺ $PWPMVUJPO౳ QPPMJOH   ฏۉɾ࠷େ౳ FYBNQMF   NOJTU JSJT  $*'"3౳ (16 DVQZ ະରԠ ཁ$VNPରԠ ݸʑͷػೳͷ։ൃ͔Β ࢀՃͯ͠Έ·ͤΜ͔ɻ
  7. Red Chainerͷ։ൃʹ͍ͭͯ • Chainer 2.0 : API ͷ੔ཧɻ (Red Chainer

    ͷϕʔε) • Chainer 3.0 : ೋ֊ඍ෼ͷα ϙʔτ (GAN͕ॻ͖΍͘͢ɻ) • Chainer 4.0 : iDeepαϙʔ τɻ(CPU൛ߴ଎Խ) • Chainer 5.0.0 b1 (5/24ϦϦʔ ε) : 5.0ͰAMD GPU(HIP)α ϙʔτ༧ఆɻ ػೳ͕ࠩ։͍ͯ௥͍͚ͭͳ͍ঢ়گ ։ൃʹࢀՃ͍ͨ͠ਓืूதɻ • Red Chainer : جຊػೳαϙʔτ (CPU ൛ͷΈ, GPU൛͸։ൃதͷCumoΛར ༻͍ͯ͘͜͠ͱΛ૝ఆ) • mnist, iris, CIFAR ͷֶशରԠɻ trainer αϙʔτɻsnapshotରԠɻ