Artificial Intelligence for Crystal (based on https://github.com/SergioFierens/ai4r)
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci add junit_output option for circleci test results output May 24, 2018
docs 100% ~~Ruby~~ Crystal code; update docs Oct 8, 2017
spec
spec_examples replace Backpropagation with Backpropagation2 (and rename w/out the '2') May 24, 2018
src
.crystal-version crystal init lib ai4c; add crenv config file Oct 1, 2017
.editorconfig crystal init lib ai4c; add crenv config file Oct 1, 2017
.gitignore
.travis.yml crystal init lib ai4c; add crenv config file Oct 1, 2017
Dockerfile drhuffman12/upgrade_to_crystal_0_26_0 Aug 22, 2018
LICENSE crystal init lib ai4c; add crenv config file Oct 1, 2017
README.md README cleanup and version bump to 0.1.3 May 24, 2018
docker-compose.yml dockerize, add notes in README, adjust circleci config ... still one … May 24, 2018
shard.yml drhuffman12/upgrade_to_crystal_0_26_0 Aug 22, 2018

README.md

ai4cr

Artificial Intelligence for Crystal (based on https://github.com/SergioFierens/ai4r)

Installation

Add this to your application's shard.yml:

dependencies:
  ai4cr:
    github: drhuffman12/ai4cr

Usage

require "ai4cr"

So far, only Ai4cr::NeuralNetwork::Backpropagation and related tests have been ported.

If you'd like another class of Ai4r ported, feel free to submit a new issue.

Contributing

  1. Fork it ( https://github.com/drhuffman12/ai4cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Build

docker-compose build

Show version

docker-compose run app crystal eval 'require "./src/ai4cr"; puts "Ai4cr version: #{Ai4cr::VERSION}"'

Test

docker-compose run app crystal spec

Docker console

docker-compose run app /bin/bash

See also

Contributors

Example Spec Results (running on a Lenovo Ideapad y700 w/ i7-6700HQ)

I included the triangle-square-cross training example as test cases.

As expected, the net sometimes correctly guesses all of the examples, more or less, depending on how many times it is trained and various other (random) factors.

Below is an example of the net successfully recognizing all nine test cases.

Setup

$ cd $MY_DEV_FOLDER

$ git clone https://github.com/drhuffman12/ai4cr.git

$ cd ai4cr

$ docker-compose build

These should NEVER fail!

$ docker-compose run app crystal spec --release --no-debug --time --error-trace --no-color
............................

Finished in 184 microseconds
28 examples, 0 failures, 0 errors, 0 pending
Execute: 00:00:00.005837007

These will probably SOMETIMES fail!

$ docker-compose run app crystal spec --release --no-debug --time --error-trace --no-color spec_examples
.............

Finished in 4.1 seconds
13 examples, 0 failures, 0 errors, 0 pending
Execute: 00:00:04.107645264

NOTE: That time, it took less than a second to build. I did notice that it took about 10 seconds to build the first run and only less than a second each successive run.