ROFMPSparseConvNet::ROFMPSparseConvNet(int dimension, int l, int k, float fmpShrink, ActivationFunction fn, int nInputFeatures, int nClasses, float p, int cudaDevice, int nTop) : SparseConvNet(dimension,nInputFeatures, nClasses, cudaDevice,nTop) {
  for (int i=0;i<l;i++) {
    addLeNetLayerROFMP(k*(i+1),2,1,2,fmpShrink,fn,p*i/(l+2));
  }
  addLeNetLayerROFMP(k*(l+1),2,1,2,1.5,fn,p*l/(l+2));
  addLeNetLayerMP(k*(l+2),2,1,1,1,fn,p*(l+1)/(l+2));
  addLeNetLayerMP(k*(l+3),1,1,1,1,fn,p);
  addSoftmaxLayer();
}
DeepC2C2::DeepC2C2(int dimension, int l, int k, ActivationFunction fn, int nInputFeatures, int nClasses, float p, int cudaDevice, int nTop) : SparseConvNet(dimension,nInputFeatures, nClasses, cudaDevice, nTop) {
  for (int i=0;i<l;i++) {
    addLeNetLayerMP((i+1)*k,2,1,1,1,fn,p*i*1.0f/l);
    addLeNetLayerMP((i+1)*k,2,1,3,2,fn,p*i*1.0f/l);
  }
  addLeNetLayerMP((l+1)*k,2,1,1,1,fn,p);
  addLeNetLayerMP((l+1)*k,1,1,1,1,fn,p);
  addSoftmaxLayer();
}
Example #3
0
 CNN (int dimension, int l, int k, ActivationFunction fn, int nInputFeatures, int nClasses, float p=0.0f, int cudaDevice=-1, int nTop=1) : SparseConvNet(dimension,nInputFeatures, nClasses, cudaDevice, nTop){
   for (int i=0;i<=l;i++)
     addLeNetLayerMP((i+1)*k*0+32<<i,
                     2+(i==0)+(i==l),
                     1,
                     (i<l)?3:1,
                     (i<l)?2:1,
                     fn,
                     p*i*1.0f/l);
   addSoftmaxLayer();
 }
DeepCNet::DeepCNet (int dimension, int l, int k, ActivationFunction fn, int nInputFeatures, int nClasses, float p, int cudaDevice, int nTop) : SparseConvNet(dimension,nInputFeatures, nClasses, cudaDevice, nTop) {
  for (int i=0;i<=l;i++)
    addLeNetLayerMP((i+1)*k,
                    (i==0)?3:2,
                    1,
                    (i<l)?3:1,
                    (i<l)?2:1,
                    fn,
                    p*i*1.0f/l);
  addSoftmaxLayer();
}
ImagenetTriangular::ImagenetTriangular
(int dimension, ActivationFunction fn,
 int nInputFeatures, int nClasses, int cudaDevice, int nTop)
  : SparseConvTriangLeNet(dimension,nInputFeatures, nClasses, cudaDevice, nTop) {
  addLeNetLayerMP( 64,7,2,2,2,fn,0.0f,10);
  addLeNetLayerMP(128,3,1,3,2,fn,0.0f,4);
  addLeNetLayerMP(256,3,1,3,2,fn,0.0f,4);
  addLeNetLayerMP(384,3,1,3,2,fn,0.0f,4);
  addLeNetLayerMP(512,3,1,1,1,fn,0.0f,4);
  addTerminalPoolingLayer(32);
  addLeNetLayerMP(1024,1,1,1,1,fn);
  addSoftmaxLayer();
}
Example #6
0
 FractionalSparseConvNet(int nInputFeatures, int nClasses, int cudaDevice)
     : SparseConvNet(2, nInputFeatures, nClasses, cudaDevice) {
   int l = 12;
   float p = 0.0f;
   const float fmpShrink = 1.414;
   for (int i = 0; i < l; i++) {
     addLeNetLayerPOFMP(f(i), 2, 1, 2, fmpShrink, VLEAKYRELU,
                        p * std::max(i - 4, 0) / (l - 3));
   }
   addLeNetLayerPOFMP(f(l), 2, 1, 1, 1, VLEAKYRELU,
                      p * std::max(l - 4, 0) / (l - 3));
   addTerminalPoolingLayer(32);
   addLeNetLayerPOFMP(f(l + 1), 1, 1, 1, 1, VLEAKYRELU,
                      p * std::max(l - 3, 0) / (l - 3));
   addSoftmaxLayer();
 }