mirror of
https://github.com/wassname/keras-contrib.git
synced 2026-06-27 16:10:11 +08:00
Add corrections as required
This commit is contained in:
@@ -84,6 +84,9 @@ else:
|
||||
datagen.fit(X_train)
|
||||
|
||||
# wrap the ImageDataGenerator to yield two label batches [y, y] for each input batch X
|
||||
# When training a NASNet model, we have to use its auxilary training head
|
||||
# Therefore the model is technically a 1 input - 2 output model, and requires
|
||||
# the label to be duplicated for the auxilary head
|
||||
def image_data_generator_wrapper(image_datagenerator, batch_size):
|
||||
iterator = datagen.flow(X_train, Y_train, batch_size=batch_size)
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ def NASNet(input_shape=None,
|
||||
|
||||
# load weights (when available)
|
||||
if weights is not None:
|
||||
warnings.warn('Weights of NASNet models have not been ported yet for Keras.')
|
||||
warnings.warn('Weights of NASNet models have not yet been ported to Keras')
|
||||
|
||||
if old_data_format:
|
||||
K.set_image_data_format(old_data_format)
|
||||
@@ -684,6 +684,10 @@ def _reduction_A(ip, p, filters, weight_decay=5e-5, id=None):
|
||||
def _add_auxilary_head(x, classes, weight_decay):
|
||||
'''Adds an auxilary head for training the model
|
||||
|
||||
From section A.7 "Training of ImageNet models" of the paper, all NASNet models are
|
||||
trained using an auxilary classifier around 2/3 of the depth of the network, with
|
||||
a loss weight of 0.4
|
||||
|
||||
# Arguments
|
||||
x: input tensor
|
||||
classes: number of output classes
|
||||
|
||||
Reference in New Issue
Block a user