def __init__(self, to_port): """ Create a new bias """ # Properly initialize the Bias AbstractConnection.__init__(self, None, to_port) self.parameters = np.zeros((1, to_port.size)) self.dimensions = (1, to_port.size) self.input = np.zeros((0, 0)) self.output = np.zeros((1, to_port.size)) self.gradient = np.zeros(self.dimensions)
def __init__(self, to_port): """ Create a new bias """ # Properly initialize the Bias AbstractConnection.__init__(self, None, to_port) self.parameters = gpu.zeros((1, to_port.size)) self.dimensions = (1, to_port.size) self.input = gpu.zeros((0,0)) self.output = gpu.zeros((1,to_port.size)) self.gradient = gpu.zeros(self.dimensions)
def __init__(self, from_port, to_port): """ Create a new full connection """ # Properly initialize the abstract connection AbstractConnection.__init__(self, from_port, to_port) # Determine the dimensions and initialize the weight matrix self.dimensions = (from_port.size, to_port.size) self.parameters = np.zeros(self.dimensions) self.input = np.zeros((1, from_port.size)) self.output = np.zeros((1, to_port.size)) self.delta = np.zeros((1, from_port.size)) self.gradient = np.zeros(self.dimensions)
def __init__(self, from_port, to_port): """ Create a new full connection """ # Properly initialize the abstract connection AbstractConnection.__init__(self, from_port, to_port) # Determine the dimensions and initialize the weight matrix self.dimensions = (from_port.size, to_port.size) self.parameters = gpu.zeros(self.dimensions) self.input = gpu.zeros((1,from_port.size)) self.output = gpu.zeros((1,to_port.size)) self.delta = gpu.zeros((1,from_port.size)) self.gradient = gpu.zeros(self.dimensions)
def __init__(self, from_port, to_port): """ Create a new identity connection """ # Properly initialize the abstract connection AbstractConnection.__init__(self, from_port, to_port) # Determine the dimensions and initialize the weight matrix self.dimensions = (from_port.size, to_port.size) self.input = np.zeros((1,from_port.size)) self.output = np.zeros((1,to_port.size)) self.delta = np.zeros((1,from_port.size)) # Dummy values to allow this to follow the AbstractConnection interface self.parameters = np.zeros((0,0)) self.gradient = np.zeros((0,0))
def __init__(self, from_port, to_port): """ Create a new identity connection """ # Properly initialize the abstract connection AbstractConnection.__init__(self, from_port, to_port) # Determine the dimensions and initialize the weight matrix self.dimensions = (from_port.size, to_port.size) self.input = gpu.zeros((1,from_port.size)) self.output = gpu.zeros((1,to_port.size)) self.delta = gpu.zeros((1,from_port.size)) # Dummy values to allow this to follow the AbstractConnection interface self.parameters = gpu.zeros((0,0)) self.gradient = gpu.zeros((0,0))