Documentation of 'edu.hitsz.c102c.cnn.CNN' Java class
CNN
edu.hitsz.c102c.cnn

Class CNN

  • All Implemented Interfaces:
    java.io.Serializable


    public class CNN
    extends java.lang.Object
    implements java.io.Serializable
    Main class to build a comvolutional neural network.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  CNN.LayerBuilder
      The constructor mode constructs layers.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CNN(CNN.LayerBuilder layerBuilder, int batchSize)
      Initialize the convolutional neural network.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static CNN loadModel(java.lang.String fileName)
      Load the model of this neural network from a file.
      void predict(Dataset testset, java.lang.String fileName)
      Write a file with predicted lables.
      void saveModel(java.lang.String fileName)
      Save convolutional network to a file.
      void setup(int batchSize)
      Set the parameters of each layer of the CNN network.
      double test(Dataset trainset)
      Test trained neural network.
      void train(Dataset trainset, int repeat)
      Train the network on the training set
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CNN

        public CNN(CNN.LayerBuilder layerBuilder,
                   int batchSize)
        Initialize the convolutional neural network.
        Parameters:
        layerBuilder - Network layer
        inputMapSize - Enter the size of the map
        classNum - The number of categories, the data set is required to convert the class label to a value of 0-classNum-1
    • Method Detail

      • train

        public void train(Dataset trainset,
                          int repeat)
        Train the network on the training set
        Parameters:
        trainset -
        repeat - The number of iterations
      • test

        public double test(Dataset trainset)
        Test trained neural network.
        Parameters:
        trainset -
        Returns:
        precison of training.
      • predict

        public void predict(Dataset testset,
                            java.lang.String fileName)
        Write a file with predicted lables.
        Parameters:
        testset - test dataset.
        fileName - ouput file with predicted lables.
      • setup

        public void setup(int batchSize)
        Set the parameters of each layer of the CNN network.
        Parameters:
        batchSize - * @param classNum
        inputMapSize -
      • saveModel

        public void saveModel(java.lang.String fileName)
        Save convolutional network to a file.
        Parameters:
        fileName - output file name.
      • loadModel

        public static CNN loadModel(java.lang.String fileName)
        Load the model of this neural network from a file.
        Parameters:
        fileName - input file name
        Returns:

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.