Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Neural networks on your phone

Neural networks on your phone

Slides for technical lightning talk on neural networks running on portable devices.

Alejandro Isaza

August 02, 2016
Tweet

Other Decks in Programming

Transcript

  1. [the AI revolution is] no longer a matter of if,

    but when. — Tech Crunch 1 1 https://techcrunch.com/2016/07/18/why-the-top-5-tech-companies-are-dead-set-on-ai/
  2. func loadNetFromFile(path: String) -> Net { guard let file =

    File.open(path, mode: .ReadOnly) else { fatalError("File not found '\(path)'") } let lstm_1 = try! loadLSTMLayerFromFile(file, name: "lstm_1") let lstm_2 = try! loadLSTMLayerFromFile(file, name: "lstm_2") let denseLayer = loadDenseLayerFromFile(file) return Net.build { self.dataLayer => lstm_1 => lstm_2 => denseLayer => self.sinkLayer } }
  3. let evaluator = try Evaluator(net: net, device: self.device) // Run

    while running { evaluator.evaluate { snapshot in let char = sinkOutput() display(string: char) dataLayer.data = self.inputFromChar(char).elements } }