Git Product home page Git Product logo

deep-learning-like-a-viking's Introduction

Deep Learning like a Viking

Building Convolutional Neural Networks with Keras

This is the git repository for my talk "Deep Learning like a Viking: Building Convolutional Neural Networks with Keras". It contains the abstract, slides, and code for the talk.

deep-learning-like-a-viking's People

Contributors

guyroyse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

deep-learning-like-a-viking's Issues

Issue decoding labels for viking runes

Ran into this issue on a fedora machine:

127.0.0.1 - - [26/Sep/2018 14:26:54] "POST /rune/detect HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/tim.winter/workspace/deep-learning-like-a-viking/code/app/rune.py", line 33, in detect_rune
    rune = labels.decode(encoded_rune)
  File "/home/tim.winter/workspace/deep-learning-like-a-viking/code/common/futhark_labels.py", line 17, in decode
    return self.__encoder.inverse_transform(y)
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/sklearn/preprocessing/label.py", line 273, in inverse_transform
    y = column_or_1d(y, warn=True)
  File "/home/tim.winter/.virtualenvs/viking/lib/python3.7/site-packages/sklearn/utils/validation.py", line 788, in column_or_1d
    raise ValueError("bad input shape {0}".format(shape))
ValueError: bad input shape ()

The solution was this patch:

index d6cef73..6e0f435 100644
--- a/code/app/rune.py
+++ b/code/app/rune.py
@@ -30,8 +30,8 @@ def detect_rune():
   file = RuneFile.from_json(request.get_json())
   rune_data = file.rune_data
   encoded_rune = model.predict(rune_data)
-  rune = labels.decode(encoded_rune)
+  rune = labels.decode([encoded_rune])
 
   print(f"Detected rune of '{encoded_rune}' decodes to '{rune}'")
 
-  return jsonify(message="OK", rune=rune)
+  return jsonify(message="OK", rune=rune[0])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.