Skip to content

Generic cleanup Metrics and Losses #204

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

Merged
merged 13 commits into from
Feb 11, 2021

Conversation

JimClarke5
Copy link
Contributor

This PR Is a reissue of the Generic Cleanup PR #203, removing commits in the branch that are already in master.

This PR effects both losses and metrics.

This PR cleans up generic parameters to cut down on the number of unique parameters to at most 1 where possible.
For example:
public abstract class Metric<U extends TNumber, T extends TNumber> {
becomes
public abstract class Metric<T extends TNumber> {

and

@Override
  public <V extends TNumber> List<Op> updateStateList(Operand<U> values, Operand<V> sampleWeights) {

Changes to:

 public List<Op> updateStateList(
      Operand<? extends TNumber> values, Operand<? extends TNumber> sampleWeights) 

@karllessard
Copy link
Collaborator

Hi @JimClarke5 , there are some javadoc issues in this PR, please take a look: https://github.com/tensorflow/java/pull/204/checks?check_run_id=1825661890

@karllessard
Copy link
Collaborator

BTW, do you have any clue why the javadoc has been reformatted? It looks like it was already conform before, I don't know why your IDE plugin would reformat these, can you please just double-check that you use your original settings?

@JimClarke5
Copy link
Contributor Author

@karllessard I fixed all the JavaDoc issues under framework except for the data package.
I have no clue why the format was messed up, but I applied IntelliJ Google format on the optimizers, losses, metrics and utils directories.

karllessard
karllessard previously approved these changes Feb 11, 2021
Copy link
Collaborator

@karllessard karllessard left a comment

Choose a reason for hiding this comment

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

Great work @JimClarke5 , that simplifies really a lot some of the APIs. I just left a really-unimportant comment about something that looks like a trailing character, please confirm and/or fix and we are good to merge

@karllessard
Copy link
Collaborator

Ok nevermind, I've remove the trailing character directly from your branch, this is now ready to merge, thanks!

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