Package dimer :: Package nnet :: Module nccn :: Class CnnModel
[hide private]
[frames] | no frames]

Class CnnModel

source code

object --+    
         |    
     Model --+
             |
            CnnModel

Nested Classes [hide private]

Inherited from Model: __metaclass__

Instance Methods [hide private]
 
__init__(self, arch, lreg_size, inshape, nout, rng, xdtype, ydtype)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
get_speeds(self)
Returns: map(lambda l: l.get_speeds(), self)
source code
 
set_speeds(self, vlst) source code
 
cost(self, l1, l2)
regularized cross entropy
source code
 
update_params(self, train_batches, gradient_f, momentum, lrate)
step on the direction of gradient
source code

Inherited from Model: __delitem__, __getitem__, __len__, __setitem__, __str__, get_params, get_weights, load, save, set_weights, weight_norm

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]

Inherited from Model: __abstractmethods__

Properties [hide private]
  top_cp_idx

Inherited from object: __class__

Method Details [hide private]

__init__(self, arch, lreg_size, inshape, nout, rng, xdtype, ydtype)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

get_speeds(self)

source code 
Returns:
map(lambda l: l.get_speeds(), self)

cost(self, l1, l2)

source code 

regularized cross entropy

Parameters:
  • l1 - L1 coefficient (float)
  • l2 - L2 coefficient (float)
Returns:
cost function

update_params(self, train_batches, gradient_f, momentum, lrate)

source code 

step on the direction of gradient

step on the direction of gradient for a whole epoch and update the model params in place. By definition speed is initialized to 0. new_speed = -rho * dE/dw + mu * speed new_weight = w + new_speed

Parameters:
  • train_batches - indexes of batches (list)
  • gradient_f - function that returns the list of gradients from the batch index.
  • momentum - mu
  • lrate - rho
Returns:
none

Property Details [hide private]

top_cp_idx

Get Method:
unreachable.top_cp_idx(self)