Skip to content
Snippets Groups Projects
Select Git revision
  • c270ff0a9c831194ab6531bc1688061f5bf60856
  • master default protected
2 results

cnnff.py

Blame
  • cnnff.py 998 B
    from scipy.signal import correlate as conv
    import numpy as np
    from activations import relu, softmax
    
    
    def cnnff(x, net):
        ''' cnnff
        
            perform feed-forward pass for convolutional network
            
            inputs: 
                x: batch of input images (N x H x W x Cin numpy array)
                net: List structure describing the network architecture (see cnn.py for details)
            
            outputs:
                net: updated net data structure that stores outputs from each layer
        '''
        
        # set input layer
        
    
        # loop over layers 1...L
        for n in range(1,len(net)):
            # current input
            inp = net[n-1]['output'] 
            # current layer
            layer = net[n] 
    
            # if layer type is Conv
            if layer['type'] is 'Conv':
                # conv followed by activation function
                ''' *** put code here *** '''    
            # if layer type is Pool
            elif layer['type'] is 'Pool':
                ''' *** put code here *** '''
        
        return net