Ejemplo n.º 1
0
 def fprop(self,
           X,
           corruption_level=None,
           noise_type="binomial",
           epoch=None,
           decay_rate=1.):
     """Forward pass of convolutional auto-encoder
     
     Parameters
     ----------
     X : 4D tensor
         data in (batch size, channel, height, width)
     corruption_level : float
         corruption_level on data
     noise_type : string
         type of noise: "binomial" or "gaussian"
     
     Returns
     -------
     out : 4-D tensor
         output list for each layer
     """
     
     out=[];
     
     if epoch is not None:
         self.corruption_level=corruption_level*(epoch**(-decay_rate));
     else:
         self.corruption_level=corruption_level;
     
     if self.corruption_level is None:
         level_out=X;
     else:
         level_out=corrupt_input(X, self.corruption_level, noise_type);
         
     for k, layer in enumerate(self.layers):
         
         level_out=layer.apply(level_out);
         
         out.append(level_out);
         
     return out;
Ejemplo n.º 2
0
    def fprop(self,
              X,
              corruption_level=None,
              noise_type="binomial",
              epoch=None,
              decay_rate=1.):
        """Forward pass of convolutional auto-encoder
        
        Parameters
        ----------
        X : 4D tensor
            data in (batch size, channel, height, width)
        corruption_level : float
            corruption_level on data
        noise_type : string
            type of noise: "binomial" or "gaussian"
        
        Returns
        -------
        out : 4-D tensor
            output list for each layer
        """

        out = []

        if epoch is not None:
            self.corruption_level = corruption_level * (epoch**(-decay_rate))
        else:
            self.corruption_level = corruption_level

        if self.corruption_level is None:
            level_out = X
        else:
            level_out = corrupt_input(X, self.corruption_level, noise_type)

        for k, layer in enumerate(self.layers):

            level_out = layer.apply(level_out)

            out.append(level_out)

        return out
Ejemplo n.º 3
0
 def fprop(self,
           X,
           corruption_level=None,
           noise_type="binomial",
           epoch=None,
           decay_rate=1.):
     """Forward pass of auto-encoder
     
     Parameters
     ----------
     X : matrix
         number of samples in (number of samples, dim of sample)
     corruption_level : float
         corruption_level on data
     noise_type : string
         type of noise: "binomial" or "gaussian"
     
     Returns
     -------
     out : matrix
         output list for each layer
     """
     
     out=[];
     
     if epoch is not None:
         self.corruption_level=corruption_level*(epoch**(-decay_rate));
     else:
         self.corruption_level=corruption_level;
     
     if self.corruption_level == None:
         level_out=X;
     else:
         level_out=corrupt_input(X, self.corruption_level, noise_type);
     for k, layer in enumerate(self.layers):
         
         level_out=layer.apply(level_out);
         
         out.append(level_out);
         
     return out;
Ejemplo n.º 4
0
    def fprop(self,
              X,
              corruption_level=None,
              noise_type="binomial",
              epoch=None,
              decay_rate=1.):
        """Forward pass of auto-encoder
        
        Parameters
        ----------
        X : matrix
            number of samples in (number of samples, dim of sample)
        corruption_level : float
            corruption_level on data
        noise_type : string
            type of noise: "binomial" or "gaussian"
        
        Returns
        -------
        out : matrix
            output list for each layer
        """

        out = []

        if epoch is not None:
            self.corruption_level = corruption_level * (epoch**(-decay_rate))
        else:
            self.corruption_level = corruption_level

        if self.corruption_level == None:
            level_out = X
        else:
            level_out = corrupt_input(X, self.corruption_level, noise_type)
        for k, layer in enumerate(self.layers):

            level_out = layer.apply(level_out)

            out.append(level_out)

        return out