rajatsen91 / deepglo

This repository contains code for the paper: https://arxiv.org/abs/1905.03806. It also contains scripts to reproduce the results in the paper.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

param represent

chamberSccc opened this issue · comments

Hi, I have used the below python file
https://github.com/rajatsen91/deepglo/blob/master/DeepGLO/DeepGLO.py

I don't understand the code in the method "step_factF_loss" on the line 255 and 256:

r = loss.detach() / l2.detach()
loss = loss + r * reg * l2

1: why use loss devide l2
2: what does the param reg means? It always be 0 in the code.

Many thanks!

  1. It ensures that the two losses are roughly of the same order but currently it is inactive as reg is set to 0.
  2. reg stands for regularization penalty. The code currently does not use regularization here and is therefore set to 0.
  1. It ensures that the two losses are roughly of the same order but currently it is inactive as reg is set to 0.
  2. reg stands for regularization penalty. The code currently does not use regularization here and is therefore set to 0.

Sorry, I'm not sure the meaning of "same order".
As I understand it, if we set reg = 0.1,the code is :

r = loss.detach() / l2.detach()
loss = loss + r * reg * l2
= loss + r * l2 * reg
= loss + loss * reg

The loss seems to be no relation with r.