Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about ema_model #1

Open
DapengFeng opened this issue Jul 21, 2020 · 0 comments
Open

Question about ema_model #1

DapengFeng opened this issue Jul 21, 2020 · 0 comments

Comments

@DapengFeng
Copy link

DapengFeng commented Jul 21, 2020

pillar-od/train.py

Lines 115 to 130 in 3eac6a9

model = builder.PillarModel(
class_id=FLAGS.class_id,
norm_type=FLAGS.norm_type,
act_type=FLAGS.act_type,
nms_iou_threshold=FLAGS.nms_iou_threshold,
nms_score_threshold=FLAGS.nms_score_threshold,
max_nms_boxes=FLAGS.max_nms_boxes,
use_oriented_per_class_nms=FLAGS.use_oriented_per_class_nms)
ema_model = builder.PillarModel(
class_id=FLAGS.class_id,
norm_type=FLAGS.norm_type,
act_type=FLAGS.act_type,
nms_iou_threshold=FLAGS.nms_iou_threshold,
nms_score_threshold=FLAGS.nms_score_threshold,
max_nms_boxes=FLAGS.max_nms_boxes,
use_oriented_per_class_nms=FLAGS.use_oriented_per_class_nms)

pillar-od/train.py

Lines 208 to 226 in 3eac6a9

with tf.GradientTape() as tape:
preds = model(inputs, training=True)
if optimizer.iterations < 1:
ema_model(inputs, training=False)
cls_loss, loc_loss = model.compute_loss(inputs, preds)
mean_cls_loss = tf.reduce_mean(cls_loss)
mean_loc_loss = tf.reduce_mean(loc_loss)
weight_loss = tf.reduce_sum(model.losses)
loss = (mean_cls_loss + mean_loc_loss + weight_loss)
training_vars = model.trainable_variables
grads = tape.gradient(loss, training_vars)
optimizer.apply_gradients(zip(grads, training_vars))
train_loss_metric.update_state(loss)
train_loc_loss_metric.update_state(mean_loc_loss)
train_cls_loss_metric.update_state(mean_cls_loss)
weight_loss_metric.update_state(weight_loss)
_momentum_update(model, ema_model)

Thanks for your great work. But I still confuse about the effect of ema_model, since the pointpillars does not apply the same setting. Could you explain the reason why you apply ema_model here, and add an ablation study on ema_model?

@DapengFeng DapengFeng changed the title Question about ema_module Question about ema_model Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant