Skip to content

Need a global counter for training. #7784

Closed
@reyoung

Description

@reyoung

Problem

A global step counter to record how many times a program has executed is needed. It is needed not only by optimizers with learning rate schedulers but also by printing metrics or debugging(such as log_every_n layer).

Solution

We can add a layer function, get_or_create_global_step_counter() in layers.control_flow module. It will return an int64 variable in CPU with an increment operator. If the counter is created before, it will not be created again.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions