Package org.encog.ml.data.buffer.codec

Examples of org.encog.ml.data.buffer.codec.ArrayDataCODEC


import org.encog.neural.networks.XOR;


public class TestExcel extends TestCase {
  public void testXLSX() {
    final ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,
        XOR.XOR_IDEAL);
    final BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));

    final ExcelCODEC codec2 = new ExcelCODEC(new File("encog.xlsx"));
    final BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));

    final ExcelCODEC codec3 = new ExcelCODEC(new File("encog.xlsx"), 2, 1);
    final BinaryDataLoader loader3 = new BinaryDataLoader(codec3);
    loader3.external2Binary(new File("encog.bin"));

    final ArrayDataCODEC codec4 = new ArrayDataCODEC();
    final BinaryDataLoader loader4 = new BinaryDataLoader(codec4);
    loader4.binary2External(new File("encog.bin"));

    final double[][] input = codec4.getInput();
    final double[][] ideal = codec4.getIdeal();

    for (int i = 0; i < XOR.XOR_INPUT.length; i++) {
      for (int j = 0; j < XOR.XOR_INPUT[i].length; j++) {
        Assert.assertEquals(input[i][j], XOR.XOR_INPUT[i][j], 0.01);
      }
View Full Code Here


public class TestBinaryData extends TestCase {
 
  public void testArrayCODEC() throws Exception
  {
    ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));
 
    ArrayDataCODEC codec2 = new ArrayDataCODEC();
    BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));
   
    double[][] input = codec2.getInput();
    double[][] ideal = codec2.getIdeal();
   
    for(int i=0;i<XOR.XOR_INPUT.length;i++)
    {
      for(int j=0;j<XOR.XOR_INPUT[i].length;j++)
      {
View Full Code Here

   
  }
 
  public void testCSV()
  {
    ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));
 
    CSVDataCODEC codec2 = new CSVDataCODEC(new File("encog.csv"), CSVFormat.ENGLISH, false);
    BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));
   
    CSVDataCODEC codec3 = new CSVDataCODEC(new File("encog.csv"), CSVFormat.ENGLISH, false, 2, 1, false);
    BinaryDataLoader loader3 = new BinaryDataLoader(codec3);
    loader3.external2Binary(new File("encog.bin"));

    ArrayDataCODEC codec4 = new ArrayDataCODEC();
    BinaryDataLoader loader4 = new BinaryDataLoader(codec4);
    loader4.binary2External(new File("encog.bin"));
   
    double[][] input = codec4.getInput();
    double[][] ideal = codec4.getIdeal();
   
    for(int i=0;i<XOR.XOR_INPUT.length;i++)
    {
      for(int j=0;j<XOR.XOR_INPUT[i].length;j++)
      {
View Full Code Here

import org.encog.neural.networks.XOR;


public class TestExcel extends TestCase {
  public void testXLSX() {
    final ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,
        XOR.XOR_IDEAL);
    final BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));

    final ExcelCODEC codec2 = new ExcelCODEC(new File("encog.xlsx"));
    final BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));

    final ExcelCODEC codec3 = new ExcelCODEC(new File("encog.xlsx"), 2, 1);
    final BinaryDataLoader loader3 = new BinaryDataLoader(codec3);
    loader3.external2Binary(new File("encog.bin"));

    final ArrayDataCODEC codec4 = new ArrayDataCODEC();
    final BinaryDataLoader loader4 = new BinaryDataLoader(codec4);
    loader4.binary2External(new File("encog.bin"));

    final double[][] input = codec4.getInput();
    final double[][] ideal = codec4.getIdeal();

    for (int i = 0; i < XOR.XOR_INPUT.length; i++) {
      for (int j = 0; j < XOR.XOR_INPUT[i].length; j++) {
        Assert.assertEquals(input[i][j], XOR.XOR_INPUT[i][j], 0.01);
      }
View Full Code Here

public class TestBinaryData extends TestCase {
 
  public void testArrayCODEC() throws Exception
  {
    ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));
 
    ArrayDataCODEC codec2 = new ArrayDataCODEC();
    BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));
   
    double[][] input = codec2.getInput();
    double[][] ideal = codec2.getIdeal();
   
    for(int i=0;i<XOR.XOR_INPUT.length;i++)
    {
      for(int j=0;j<XOR.XOR_INPUT[i].length;j++)
      {
View Full Code Here

   
  }
 
  public void testCSV()
  {
    ArrayDataCODEC codec = new ArrayDataCODEC(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    BinaryDataLoader loader = new BinaryDataLoader(codec);
    loader.external2Binary(new File("encog.bin"));
 
    CSVDataCODEC codec2 = new CSVDataCODEC(new File("encog.csv"), CSVFormat.ENGLISH, false);
    BinaryDataLoader loader2 = new BinaryDataLoader(codec2);
    loader2.binary2External(new File("encog.bin"));
   
    CSVDataCODEC codec3 = new CSVDataCODEC(new File("encog.csv"), CSVFormat.ENGLISH, false, 2, 1, false);
    BinaryDataLoader loader3 = new BinaryDataLoader(codec3);
    loader3.external2Binary(new File("encog.bin"));

    ArrayDataCODEC codec4 = new ArrayDataCODEC();
    BinaryDataLoader loader4 = new BinaryDataLoader(codec4);
    loader4.binary2External(new File("encog.bin"));
   
    double[][] input = codec4.getInput();
    double[][] ideal = codec4.getIdeal();
   
    for(int i=0;i<XOR.XOR_INPUT.length;i++)
    {
      for(int j=0;j<XOR.XOR_INPUT[i].length;j++)
      {
View Full Code Here

TOP

Related Classes of org.encog.ml.data.buffer.codec.ArrayDataCODEC

Copyright © 2018 www.massapicom. 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.