def create_model(self, model_input, num_classes=10, l2_penalty=1e-8, **unused_params):
"""Creates a logistic model.
Args:
model_input: 'batch' x 'num_features' matrix of input features.
num_classes: The number of classes in the dataset.
Returns:
A dictionary with a tensor containing the probability predictions of the
model in the 'predictions' key. The dimensions of the tensor are
batch_size x num_classes."""
net = slim.flatten(model_input)
output = slim.fully_connected(
net, num_classes, activation_fn=None,
weights_regularizer=slim.l2_regularizer(l2_penalty))
return {"predictions": output}
models.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录