Skip to content

Commit

Permalink
- model_img close to other papers like ProtoNets
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmic committed Aug 22, 2019
1 parent 2272f67 commit c991b7d
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions mini_imagenet_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,21 @@ def generate_add_samples(self, phase = 'train'):

inputs = Input(shape=(None,84,84,3))
print('the shape', inputs.shape)
conv1 = TimeDistributed(Conv2D(50, 7, 1 , activation = 'relu'))(inputs)
conv2 = TimeDistributed(MaxPooling2D(pool_size = (3,3)))(conv1)
conv3 = TimeDistributed(Conv2D(100, 7, 1 , activation = 'relu'))(conv2)
conv4 = TimeDistributed(MaxPooling2D(pool_size = (3,3)))(conv3)
conv1 = TimeDistributed(Conv2D(64, 3, padding='same', activation = 'relu'))(inputs)
pool1 = TimeDistributed(MaxPooling2D(pool_size = 2))(conv1)
conv2 = TimeDistributed(Conv2D(64, 3, padding='same', activation = 'relu'))(pool1)
pool2 = TimeDistributed(MaxPooling2D(pool_size = 2))(conv2)
conv3 = TimeDistributed(Conv2D(64, 3, padding='same', activation = 'relu'))(pool2)
pool3 = TimeDistributed(MaxPooling2D(pool_size = 2))(conv3)
conv4 = TimeDistributed(Conv2D(64, 3, padding='same', activation = 'relu'))(pool3)
pool4 = TimeDistributed(MaxPooling2D(pool_size = 2))(conv4)

#conv3 = TimeDistributed(Conv2D(5, 5, (3,3) , padding='same', activation = 'relu'))(conv2)
flat = TimeDistributed(Flatten())(conv4)
x = TimeDistributed(Dense(100, activation = 'relu'))(flat)
predictions = Activation('softmax')(x)
flat = TimeDistributed(Flatten())(pool4)
#x = TimeDistributed(Dense(100, activation = 'relu'))(flat)
#predictions = Activation('softmax')(x)

model_img = Model(inputs=inputs, outputs=predictions)
model_img = Model(inputs=inputs, outputs=flat)

#model_img.compile(loss='categorical_crossentropy', optimizer='Adam', metrics=['categorical_accuracy'])

Expand Down

0 comments on commit c991b7d

Please sign in to comment.