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

[onert-micro] Introduce Optimizers #13211

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

BalyshevArtem
Copy link
Contributor

This pr introduces optimizers entities: SGD and Adam.

for issue #12873
from draft: #13107

ONE-DCO-1.0-Signed-off-by: Artem Balyshev [email protected]

This pr introduces optimizers entities: SGD and Adam.

ONE-DCO-1.0-Signed-off-by: Artem Balyshev <[email protected]>
Torrero
Torrero previously approved these changes Jun 17, 2024
Copy link
Contributor

@Torrero Torrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

float epsilon = training_config.epsilon;
for (uint32_t i = 0; i < flat_size; ++i)
{
float exponent_corrected = exponent_data[i] / (1.f - beta_in_pow_batch);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check the division by zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added checks

auto batches = static_cast<float>(training_config.batch_size);
for (uint32_t i = 0; i < flat_size; ++i)
{
const auto cur_val = calculated_data[i] / batches;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const auto cur_val = calculated_data[i] / batches;
const auto cur_val = calculated_data[i];

not sure but, this one is correct ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thank you, you are right

@BalyshevArtem BalyshevArtem merged commit da89844 into Samsung:master Jun 18, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants