Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (20 sloc) 574 Bytes
require 'hubris'
require 'sinatra/base'
module Neurosis
class Perceptron
hubris :source => 'Perceptron.hs', :no_strict => true
end
class Server < Sinatra::Base
def perceptron() Perceptron.new end
get '/' do
options = JSON.parse params[:input]
if output_nodes = perceptron.hubris_learn(options)
output_nodes.to_json
else
status 400
"Please specify all correct options for: " +
"input_patterns, output_patterns, hidden_weights_group, output_weights_group, learning_rate"
end
end
end
end
Something went wrong with that request. Please try again.