Skip to content

Instantly share code, notes, and snippets.

View doryphores's full-sized avatar

Martin Laine doryphores

  • Simply Business
  • London, UK
View GitHub Profile
@doryphores
doryphores / rock-paper-scissors.md
Last active December 27, 2018 14:45
Notes and example code for rock paper scissors ML
  • this is a browser-only solution so you have to start and train your model every time you load the page (you can't save it to re-use later)

  • when I try the game and train it with 200 images for each move, it still gets it wrong very often, can you train it to get it right all the time with hundreds of images?

this is where the model is trained: https://github.com/reiinakano/tfjs-rock-paper-scissors/blob/ec28954f0f1cd48e5e392583c5403d1a9712f018/main.js#L190-L197

to use a collection of images instead of the webcam, you need to iterate over a collection of images with their labels, something like this (this is ES6 JS code that needs to be transpiled with babel and something like webpack or browserify to run in your browser):

import React from 'react'
export default class Test extends React.Component {
constructor () {
this.state = {
page: 0
}
}
render () {

Keybase proof

I hereby claim:

  • I am doryphores on github.
  • I am doryphores (https://keybase.io/doryphores) on keybase.
  • I have a public key whose fingerprint is 291F FB0B 43C6 D3DD A471 F387 E4CA F77A 9004 56E2

To claim this, I am signing this object: