ai4cr alternatives and similar shards
Based on the "Machine Learning" category.
Alternatively, view ai4cr alternatives based on common mentions on social networks and blogs.
Do you think we are missing an alternative of ai4cr or a related project?
Artificial Intelligence for Crystal (based on https://github.com/SergioFierens/ai4r)
Add this to your application's
dependencies: ai4cr: github: drhuffman12/ai4cr branch: master
So far, only Ai4cr::NeuralNetwork::Backpropagation and related tests have been ported.
marshal_load from ai4r have been replaced by
from_json instead, e.g.:
# Create and save a net net = Ai4cr::NeuralNetwork::Backpropagation.new(...) File.write("../ai4cr_ui/db/seeds/BackpropagationNet.new.json",net.to_json) # Train and save a net net.train(some_input, expected_output) File.write("../ai4cr_ui/db/seeds/BackpropagationNet.trained.json",net.to_json) # Verify serialization in a spec json = net.to_json net2 = Ai4cr::NeuralNetwork::Backpropagation.from_json(json) assert_approximate_equality_of_nested_list net.weights, net2.weights, 0.000000001
To build and run them:
crystal build --release src/bench/mini_nets_vs_backprop.cr ./mini_nets_vs_backprop
To dig deeper into performance refinement:
crystal build --release src/mini_nets_vs_backprop mkdir -p tmp/ valgrind --tool=callgrind --cache-sim=yes --branch-sim=yes --callgrind-out-file=tmp/mini_nets_vs_backprop.out ./mini_nets_vs_backprop
[x] Generate an error history plot using
crystal spec spec_examplesto see more error history plot examples. NOTE: These run short training sessions, so some tests are likely to fail some of the time.)
[ ] Add Cmn ("Connectable Mini Networks") (WIP)
- [x] simple benchmark comparisons
- [x] Learning Styles
- [x] Pelu
- [x] Relu
- [x] Sigmoid
- [x] Tanh
- [x] MiniNet
- [x] Common modules
- [x] JSON importable/exportable
- [x] can use various 'Learning Styles'
- [ ] (?) move 'Learning Styles'-specific methods from MiniNet into Enum
- [ ] misc Connected Net Sets (WIP)
- [x] Chain
- [ ] RNN
- [ ] (TBD)
- [ ] ...
- [ ] (TBD)
- [ ] ...
[ ] Add RNN
[ ] Port from
- [ ] classifiers
- [ ] classifier.rb
- [ ] hyperpipes.rb
- [ ] ib1.rb
- [ ] id3.rb
- [ ] multilayer_perceptron.rb
- [ ] naive_bayes.rb
- [ ] one_r.rb
- [ ] prism.rb
- [ ] simple_linear_regression.rb
- [ ] votes.rb
- [ ] zero_r.rb
- [ ] clusterers
- [ ] average_linkage.rb
- [ ] bisecting_k_means.rb
- [ ] centroid_linkage.rb
- [ ] clusterer.rb
- [ ] complete_linkage.rb
- [ ] diana.rb
- [ ] k_means.rb
- [ ] median_linkage.rb
- [ ] single_linkage.rb
- [ ] ward_linkage_hierarchical.rb
- [ ] ward_linkage.rb
- [ ] weighted_average_linkage.rb
- [ ] data
- [ ] data_set.rb
- [ ] parameterizable.rb
- [ ] proximity.rb
- [ ] statistics.rb
- [ ] experiment
- [ ] classifier_evaluator.rb
- [ ] genetic_algorithm
- [ ] genetic_algorithm.rb
- [ ] neural_network
- [x] backpropagation.rb
- [ ] hopfield.rb
- [ ] som
- [ ] layer.rb
- [ ] node.rb
- [ ] som.rb
- [ ] two_phase_layer.rb
If you'd like another class of Ai4r ported, feel free to submit a new issue.
- Fork it ( https://github.com/drhuffman12/ai4cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
docker-compose run app scripts/reformat
# for a cleaner build: docker-compose build --force-rm --no-cache --pull # normally: docker-compose build
docker-compose run app scripts/version_info
docker-compose run app crystal spec
docker-compose run app /bin/bash
icr -r ./src/ai4cr
The docs at: https://drhuffman12.github.io/ai4cr/
The specs and https://github.com/SergioFierens/ai4r for more info.
- drhuffman12 Daniel Huffman - creator, maintainer
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.
$ cd $MY_DEV_FOLDER $ git clone https://github.com/drhuffman12/ai4cr.git $ cd ai4cr $ docker-compose build
These should NEVER fail!
For any tests that should NEVER fail (e.g.: in spite of sufficient training), put them into
spec, and run them via:
$ docker-compose run app scripts/test_always .............................. Finished in 4.01 milliseconds 30 examples, 0 failures, 0 errors, 0 pending Execute: 00:00:00.010855717
These will probably SOMETIMES fail!
For any tests that could fails sometimes (e.g.: if not trained enough), put them into
spec_examples, and run them via:
$ docker-compose run app scripts/test_sometimes ............. Finished in 6.76 seconds 16 examples, 0 failures, 0 errors, 0 pending Execute: 00:00:06.769663359
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.