Sha256: ace4b4925edcfc6558fc513d8bb4824351c5c66b7396d7ae18dcc545063fff4b

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

# 
# neural_network_test.rb
# 
# This is a unit test file for the backpropagation neural network implemented
# in ai4r 
# 
# Author::    Sergio Fierens
# License::   MPL 1.1
# Project::   ai4r
# Url::       http://ai4r.rubyforge.org/
#
# You can redistribute it and/or modify it under the terms of 
# the Mozilla Public License version 1.1  as published by the 
# Mozilla Foundation at http://www.mozilla.org/MPL/MPL-1.1.txt
# 
 

require File.dirname(__FILE__) + '/../../lib/neural_network/backpropagation'

require 'test/unit'

NeuralNetwork::Backpropagation.send(:public, *NeuralNetwork::Backpropagation.protected_instance_methods)  
NeuralNetwork::Backpropagation.send(:public, *NeuralNetwork::Backpropagation.private_instance_methods)

module NeuralNetwork
  
  
  class BackpropagationTest < Test::Unit::TestCase
     
    def test_eval
      #Test set 1
      net = Backpropagation.new([3, 2])
      y = net.eval([3, 2, 3])
      assert y.length == 2
      #Test set 2
      net = Backpropagation.new([2, 4, 8, 10, 7])
      y = net.eval([2, 3])
      assert y.length == 7
    end

  end


end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ai4r-1.0 test/neural_network/backpropagation_test.rb
ai4r-1.1 test/neural_network/backpropagation_test.rb