Package zdenekdrahos.AI.NeuralNetwork

Source Code of zdenekdrahos.AI.NeuralNetwork.INeuralNetworkTest

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zdenekdrahos.AI.NeuralNetwork;

import org.junit.Test;
import static org.junit.Assert.*;
import zdenekdrahos.AI.ActivationFunctions.ActivationFactory;
import zdenekdrahos.AI.ActivationFunctions.IActivationFactory;
import zdenekdrahos.AI.NetworkTestUtil;
import zdenekdrahos.AI.NeuralNetwork.Layers.ILayer;
import zdenekdrahos.AI.NeuralNetwork.Layers.Layer;

public class INeuralNetworkTest {
   
    private INeuralNetwork network = new NeuralNetwork();
    private IActivationFactory factory = new ActivationFactory();

    @Test
    public void testAddLayer() {
        ILayer layer = new Layer(1, factory.getLinearFunction());
        assertEquals(0, network.getLayersCount());
        network.addLayer(layer);       
        assertEquals(1, network.getLayersCount());
        network.addLayer(layer);
        assertEquals(2, network.getLayersCount());
    }

    @Test
    public void testSetWeights() {       
        network = NetworkTestUtil.getNetwork();
        NetworkTestUtil.assertNetworkWeights(network, NetworkTestUtil.getWeights());
    }   

}
TOP

Related Classes of zdenekdrahos.AI.NeuralNetwork.INeuralNetworkTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.