Skip to content

Conversation

kardevroop
Copy link
Collaborator

Describe your changes

Added functionality for the StockLoss I function.

What type is this change?

  • Bug fix
  • New feature

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have tested on MAC OS system
  • I have tested on Ubuntu system
  • I have tested on the RIT research cluster and updated the spack packages for compiling
  • My changes generate no new warnings
  • If the PR is related to a new feature, I added the running scripts for the new feature

How Has This Been Tested?

@kardevroop kardevroop requested a review from travisdesell June 18, 2025 23:14
rnn/rnn.cxx Outdated
} else if (this->loss == "mae") {
mse = calculate_error_mae(outputs);
backward_pass(mse * (1.0 / outputs[0].size()) * 2.0, using_dropout, training, dropout_probability);
} else {
Copy link
Owner

Choose a reason for hiding this comment

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

This should be it's own case (else if loss == "stock"), then there should be a final else case which prints an error if a user didn't give one of the available loss options.

rnn/mse.cxx Outdated
}
}

void get_stock_loss (const vector<double>& output_values, const vector<double>& expected, double& loss_sum, vector<double>& deltas,
Copy link
Owner

Choose a reason for hiding this comment

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

these should go into a stock_loss.cxx/hxx file.

mses[i] = rnn->calculate_error_mae(outputs);
} else if (loss == "stock") {
mses[i] = rnn->calculate_error_stock_loss(inputs, outputs);
}
Copy link
Owner

Choose a reason for hiding this comment

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

add an else case here with a helpful error message if an inappropriate loss is given (and include in the error message the available options).

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.

2 participants