我不仅想观察应该在训练期间优化的连续错误,还想观察训练期间另一个不可区分的指标(如 top1 或 top5 分类错误)。可能吗?
例子:
outputs = MyModel(inputs)
continuous_loss = some_loss(outputs, labels)
# it could return tensor with dimension different than continuous loss,
# which return only one scalar for batch
another_loss = some_another_loss(outputs, labels, ...)
optimizer = tf.RMSPropOptimizer(lr, momentum)
train_op = slim.learning.create_train_op(continuous_loss, optimizer, ...)
# this call is blocking and i can't run another op with session.run
slim.learning.train(train_op, logdir, ...)
我需要的只是重新定义train_step_fn并传递给[train_op, another_loss]的slim.learning.train数组