Functions | Variables
models Namespace Reference

Functions

def Conv2d_All (x, nb_filter, kernel_size, padding='same', strides=(1, 1), name=None)
 A version of GoogLenet ##############. More...
 
def Inception (x, nb_filter)
 
def CVN (num_classes)
 

Variables

int seed = 7
 

Function Documentation

def models.Conv2d_All (   x,
  nb_filter,
  kernel_size,
  padding = 'same',
  strides = (1,1),
  name = None 
)

A version of GoogLenet ##############.

Definition at line 14 of file models.py.

Referenced by CVN(), and Inception().

14 def Conv2d_All(x, nb_filter,kernel_size, padding='same',strides=(1,1),name=None):
15  if name is not None:
16  bn_name = name + '_bn'
17  conv_name = name + '_conv'
18  else:
19  bn_name = None
20  conv_name = None
21 
22  x = Conv2D(nb_filter,kernel_size,padding=padding,strides=strides,activation='relu',name=conv_name)(x)
23  x = BatchNormalization(axis=3,name=bn_name)(x)
24  return x
25 
def Conv2d_All(x, nb_filter, kernel_size, padding='same', strides=(1, 1), name=None)
A version of GoogLenet ##############.
Definition: models.py:14
def models.CVN (   num_classes)

Definition at line 37 of file models.py.

References cet::sqlite::detail.concatenate(), Conv2d_All(), and Inception().

37 def CVN(num_classes):
38  input1 = Input(shape=(1, 100,80), dtype='float32', name='input1')
39  input2 = Input(shape=(1, 100,80), dtype='float32', name='input2')
40 
41  x1 = Conv2d_All(input1,64,(7,7),strides=(2,2),padding='same')
42  x1 = MaxPooling2D(pool_size=(3,3),strides=(2,2),padding='same')(x1)
43  x1 = Conv2d_All(x1,192,(3,3),strides=(1,1),padding='same')
44  x1 = MaxPooling2D(pool_size=(3,3),strides=(2,2),padding='same')(x1)
45  x1 = Inception(x1,64)
46  x1 = Inception(x1,120)
47  x1 = MaxPooling2D(pool_size=(3,3),strides=(2,2),padding='same')(x1)
48  x1 = Inception(x1,128)
49  x1 = AveragePooling2D(pool_size=(7,7),strides=(7,7),padding='same')(x1)
50  x1 = Flatten()(x1)
51  x1 = Dense(512,activation='relu', W_regularizer=l2(0.1))(x1)
52 
53  x2 = Conv2d_All(input2,64,(7,7),strides=(2,2),padding='same')
54  x2 = MaxPooling2D(pool_size=(3,3),strides=(2,2),padding='same')(x2)
55  x2 = Conv2d_All(x2,192,(3,3),strides=(1,1),padding='same')
56  x2 = MaxPooling2D(pool_size=(3,3),strides=(2,2),padding='same')(x2)
57  x2 = Inception(x2,64)
58  x2 = Inception(x2,120)
59  x2 = MaxPooling2D(pool_size=(3,3),strides=(2,2),padding='same')(x2)
60  x2 = Inception(x2,128)
61  x2 = AveragePooling2D(pool_size=(7,7),strides=(7,7),padding='same')(x2)
62  x2 = Flatten()(x2)
63  x2 = Dense(512,activation='relu', W_regularizer=l2(0.1))(x2)
64 
65  x = concatenate([x1, x2])
66  x = Dense(1024, activation='relu')(x)
67  out = Dense(num_classes, activation='softmax', name='out')(x)
68  model = Model(inputs=[input1, input2], outputs=[out])
69 
70  return model
71 
rosenbrock_model_namespace::rosenbrock_model Model
std::string concatenate()
Definition: select.h:139
def Inception(x, nb_filter)
Definition: models.py:26
def CVN(num_classes)
Definition: models.py:37
def Conv2d_All(x, nb_filter, kernel_size, padding='same', strides=(1, 1), name=None)
A version of GoogLenet ##############.
Definition: models.py:14
def models.Inception (   x,
  nb_filter 
)

Definition at line 26 of file models.py.

References cet::sqlite::detail.concatenate(), and Conv2d_All().

Referenced by CVN().

26 def Inception(x,nb_filter):
27  b1x1 = Conv2d_All(x,nb_filter,(1,1), padding='same',strides=(1,1),name=None)
28  b3x3 = Conv2d_All(x,nb_filter,(1,1), padding='same',strides=(1,1),name=None)
29  b3x3 = Conv2d_All(b3x3,nb_filter,(3,3), padding='same',strides=(1,1),name=None)
30  b5x5 = Conv2d_All(x,nb_filter,(1,1), padding='same',strides=(1,1),name=None)
31  b5x5 = Conv2d_All(b5x5,nb_filter,(1,1), padding='same',strides=(1,1),name=None)
32  bpool = MaxPooling2D(pool_size=(3,3),strides=(1,1),padding='same')(x)
33  bpool = Conv2d_All(bpool,nb_filter,(1,1),padding='same',strides=(1,1),name=None)
34  x = concatenate([b1x1,b3x3,b5x5,bpool],axis=3)
35  return x
36 
std::string concatenate()
Definition: select.h:139
def Inception(x, nb_filter)
Definition: models.py:26
def Conv2d_All(x, nb_filter, kernel_size, padding='same', strides=(1, 1), name=None)
A version of GoogLenet ##############.
Definition: models.py:14

Variable Documentation

int models.seed = 7

Definition at line 7 of file models.py.