Crystal bindings for the FANN C lib
Add this to your application's shard.yml
:
dependencies:
crystal-fann:
github: NeuraLegion/crystal-fann
Look at the spec for most functions
ann = Fann::Network::Standard.new(2, [2], 1)
ann.randomize_weights(0.0, 1.0)
3000.times do
ann.train_single([1.0, 0.0], [0.5])
end
result = ann.run([1.0, 0.0])
# Remember to close the network when done to free allocated C memory
ann.close
(result < [0.55] && result > [0.45]).should be_true
# Work on array of test data (batch)
ann = Fann::Network::Standard.new(2, [3], 1)
input = [[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]]
output = [[0.0], [1.0], [1.0], [0.0]]
train_data = Fann::TrainData.new(input, output)
data = train_data.train_data
ann.randomize_weights(0.0, 1.0)
if data
ann.train_batch(data, {:max_runs => 8000, :desired_mse => 0.001, :log_each => 1000})
end
result = ann.run([1.0, 1.0])
ann.close
(result < [0.15]).should be_true
# Work on array of test data using the Cascade2 algorithm (no hidden layers, net will build it alone)
ann = Fann::Network::Cascade.new(2, 1)
input = [[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]]
output = [[0.0], [1.0], [1.0], [0.0]]
train_data = Fann::TrainData.new(input, output)
data = train_data.train_data
ann.train_algorithm(LibFANN::TrainEnum::TrainRprop)
ann.randomize_weights(0.0, 1.0)
if data
ann.train_batch(data, {:max_neurons => 500, :desired_mse => 0.001, :log_each => 10})
end
result = ann.run([1.0, 1.0])
ann.close
(result < [0.1]).should be_true
All C lib docs can be found here -> http://libfann.github.io/fann/docs/files/fann-h.html
I guess more stuff will be added once more people will use it.
Crystal Reports(水晶报表)是一款商务智能(BI)软件,主要用于设计及产生报表。水晶报表是业内最专业、功能最强的报表系统,它除了强大的报表功能外,最大的优势是实现了与绝大多数流行开发工具的集成和接口。在VS.Net平台做过报表开发的程序员,一定都对水晶报表强大、高效、集成等特性留下了深刻印象。 除了开发新程序外,在工作中我们常需要接触到很多较早的软件系统报表功能升级的需求,如果能结合
crystal-mysql MySQL driver implement natively in Crystal, without relying on external libraries. Check crystal-db for general db driver documentation. crystal-mysql driver is registered under mysql://
crystal-pg A native, non-blocking Postgres driver for Crystal usage This driver now uses the crystal-db project. Documentation on connecting,querying, etc, can be found at: https://crystal-lang.org/do
Redis Client for Crystal A Redis client for the Crystal programming language. Features Performance (> 680,000 commands per second using pipeline on a MacBook Air with a single client thread) Pipelinin
crystal-nodejs Node.js engine for crystal-lang. JS code and npm module executes on crystal-nodejs, And don't need to install Node.js binary.Explain about architecture, Compiled as a shared object Node
Crystal Website Powered by Jekyll Development setup (via docker) Checkout the repository Run $ docker-compose up Open a browser in localhost:4000 The docker container will launch jekyll with --increme