def __init__(self, name, inputs, trainFrom = None, reuse=False, weightDecay=0.00004, batchNormDecay=0.9997, batchNormEpsilon=0.001, freezeBatchNorm=False):
self.name = name
self.inputs = inputs
self.trainFrom = trainFrom
with slim.arg_scope([slim.conv2d, slim.fully_connected],
weights_regularizer=None,
biases_regularizer=None):
batch_norm_params = {
'decay': batchNormDecay,
'epsilon': batchNormEpsilon,
}
# Set activation_fn and parameters for batch_norm.
with slim.arg_scope([slim.conv2d],
activation_fn=tf.nn.relu,
normalizer_fn=slim.batch_norm,
normalizer_params=batch_norm_params) as scope:
self.endPoints, self.scope, self.scopeList = InceptionResnetV2.define(inputs, weightDecay = weightDecay, trainFrom=trainFrom, scope=name, reuse = reuse, freezeBatchNorm = freezeBatchNorm)
评论列表
文章目录