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

Class Layer

  • All Implemented Interfaces:
    java.io.Serializable


    public class Layer
    extends java.lang.Object
    implements java.io.Serializable
    CNN network layer.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  Layer.Size
      Get sample size, only sampling layer has scaleSize, other layers are not null.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static Layer buildConvLayer(int outMapNum, Layer.Size kernelSize)
      Build convolution layer.
      static Layer buildInputLayer(Layer.Size mapSize)
      Build impot layer.
      static Layer buildOutputLayer(int classNum)
      Construct the output layer, the number of categories, determine the number of output units according to the number of categories.
      static Layer buildSampLayer(Layer.Size scaleSize)
      Build sampling layer.
      double getBias(int mapNo)
      Get Bias.
      int getClassNum()
      Get type.
      double[][] getError(int mapNo)
      Get the mapNo map of the residual.
      double[][] getError(int recordId, int mapNo)
      Get the residual of mapNo in the recordId record.
      double[][][][] getErrors()
      Get all the residuals (each record and each map).
      double[][][][] getKernel()
      Get kernel.
      double[][] getKernel(int i, int j)
      Get the convolution kernel of the previous layer i map to the current layer j map.
      Layer.Size getKernelSize()
      Get the size of the convolution kernel, only the kernel layer has kernelSize, and all other layers are null.
      double[][] getMap(int index)
      Get the index map matrix.
      double[][] getMap(int recordId, int mapNo)
      Set map.
      double[][][][] getMaps()
      »ñÈ¡batch¸÷¸ömap¾ØÕó
      Layer.Size getMapSize()
      Get map size.
      int getOutMapNum()
      Get number of maps.
      Layer.Size getScaleSize()
      Get sample size, only sampling layer has scaleSize, other layers are not null.
      edu.hitsz.c102c.cnn.Layer.LayerType getType()
      Get type.
      void initBias(int frontMapNum)
      ³õʼ»¯Æ«ÖÃ
      void initErros(int batchSize)
      Initiazlie errors.
      void initKernel(int frontMapNum)
      Subtract the size size and append a value append to x and y respectively.
      void initOutmaps(int batchSize)
      ³õʼ»¯Êä³ömap
      void initOutputKerkel(int frontMapNum, Layer.Size size)
      Randomly initialize the convolution kernel.
      static void prepareForNewBatch()
      Prepare for the next batch of training·
      static void prepareForNewRecord()
      Prepare the next recorded workout.
      void setBias(int mapNo, double value)
      Set bias.
      void setError(int mapNo, double[][] matrix) 
      void setError(int mapNo, int mapX, int mapY, double value) 
      void setKernel(int lastMapNo, int mapNo, double[][] kernel) 
      void setMapSize(Layer.Size mapSize)
      Set map size.
      void setMapValue(int mapNo, double[][] outMatrix)
      ÒÔ¾ØÕóÐÎʽÉèÖõÚmapNo¸ömapµÄÖµ
      void setMapValue(int mapNo, int mapX, int mapY, double value)
      ÉèÖÃmapÖµ
      void setOutMapNum(int outMapNum)
      ÉèÖÃÊä³ömapµÄ¸öÊý
      • Methods inherited from class java.lang.Object

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

      • prepareForNewBatch

        public static void prepareForNewBatch()
        Prepare for the next batch of training·
      • prepareForNewRecord

        public static void prepareForNewRecord()
        Prepare the next recorded workout.
      • buildInputLayer

        public static Layer buildInputLayer(Layer.Size mapSize)
        Build impot layer.
        Parameters:
        mapSize -
        Returns:
      • buildConvLayer

        public static Layer buildConvLayer(int outMapNum,
                                           Layer.Size kernelSize)
        Build convolution layer.
        Returns:
      • buildSampLayer

        public static Layer buildSampLayer(Layer.Size scaleSize)
        Build sampling layer.
        Parameters:
        scaleSize -
        Returns:
      • buildOutputLayer

        public static Layer buildOutputLayer(int classNum)
        Construct the output layer, the number of categories, determine the number of output units according to the number of categories.
        Returns:
      • getMapSize

        public Layer.Size getMapSize()
        Get map size.
        Returns:
      • setMapSize

        public void setMapSize(Layer.Size mapSize)
        Set map size.
        Parameters:
        mapSize -
      • getType

        public edu.hitsz.c102c.cnn.Layer.LayerType getType()
        Get type.
        Returns:
      • getOutMapNum

        public int getOutMapNum()
        Get number of maps.
        Returns:
      • setOutMapNum

        public void setOutMapNum(int outMapNum)
        ÉèÖÃÊä³ömapµÄ¸öÊý
        Parameters:
        outMapNum -
      • getKernelSize

        public Layer.Size getKernelSize()
        Get the size of the convolution kernel, only the kernel layer has kernelSize, and all other layers are null.
        Returns:
      • getScaleSize

        public Layer.Size getScaleSize()
        Get sample size, only sampling layer has scaleSize, other layers are not null.
        Returns:
      • initKernel

        public void initKernel(int frontMapNum)
        Subtract the size size and append a value append to x and y respectively.
        Parameters:
        frontMapNum -
      • initOutputKerkel

        public void initOutputKerkel(int frontMapNum,
                                     Layer.Size size)
        Randomly initialize the convolution kernel.
        Parameters:
        frontMapNum -
        size -
      • initBias

        public void initBias(int frontMapNum)
        ³õʼ»¯Æ«ÖÃ
        Parameters:
        frontMapNum -
      • initOutmaps

        public void initOutmaps(int batchSize)
        ³õʼ»¯Êä³ömap
        Parameters:
        batchSize -
      • setMapValue

        public void setMapValue(int mapNo,
                                int mapX,
                                int mapY,
                                double value)
        ÉèÖÃmapÖµ
        Parameters:
        mapNo - µÚ¼¸¸ömap
        mapX - mapµÄ¸ß
        mapY - mapµÄ¿í
        value -
      • setMapValue

        public void setMapValue(int mapNo,
                                double[][] outMatrix)
        ÒÔ¾ØÕóÐÎʽÉèÖõÚmapNo¸ömapµÄÖµ
        Parameters:
        mapNo -
        outMatrix -
      • getMap

        public double[][] getMap(int index)
        Get the index map matrix. In performance considerations, no duplicate objects are returned, but the reference is returned directly, and the caller must be careful. Avoid modifying outmaps. If you need to modify, please call setMapValue(...)
        Parameters:
        index -
        Returns:
      • getKernel

        public double[][] getKernel(int i,
                                    int j)
        Get the convolution kernel of the previous layer i map to the current layer j map.
        Parameters:
        i - ÉÏÒ»²ãµÄmapϱê
        j - µ±Ç°²ãµÄmapϱê
        Returns:
      • setError

        public void setError(int mapNo,
                             int mapX,
                             int mapY,
                             double value)
        Parameters:
        mapNo -
        mapX -
        mapY -
        value -
      • setError

        public void setError(int mapNo,
                             double[][] matrix)
        Parameters:
        mapNo -
        matrix -
      • getError

        public double[][] getError(int mapNo)
        Get the mapNo map of the residual. Does not return a copy of the object, but directly returns a reference, call the cautious, Avoid modifying errors. If you need to modify, please call setError(...)
        Parameters:
        mapNo -
        Returns:
      • getErrors

        public double[][][][] getErrors()
        Get all the residuals (each record and each map).
        Returns:
      • initErros

        public void initErros(int batchSize)
        Initiazlie errors.
        Parameters:
        batchSize -
      • setKernel

        public void setKernel(int lastMapNo,
                              int mapNo,
                              double[][] kernel)
        Parameters:
        lastMapNo -
        mapNo -
        kernel -
      • getBias

        public double getBias(int mapNo)
        Get Bias.
        Parameters:
        mapNo -
        Returns:
      • setBias

        public void setBias(int mapNo,
                            double value)
        Set bias.
        Parameters:
        mapNo -
        value -
      • getMaps

        public double[][][][] getMaps()
        »ñÈ¡batch¸÷¸ömap¾ØÕó
        Returns:
      • getError

        public double[][] getError(int recordId,
                                   int mapNo)
        Get the residual of mapNo in the recordId record.
        Parameters:
        recordId -
        mapNo -
        Returns:
      • getMap

        public double[][] getMap(int recordId,
                                 int mapNo)
        Set map.
        Parameters:
        recordId -
        mapNo -
        Returns:
      • getClassNum

        public int getClassNum()
        Get type.
        Returns:
      • getKernel

        public double[][][][] getKernel()
        Get kernel.
        Returns:

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.