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

users can disable the gradient computation #2835

Closed
wants to merge 15 commits into from

Conversation

yorkerlin
Copy link
Member

No description provided.

@yorkerlin yorkerlin changed the title users can diable the gradient computation users can disable the gradient computation May 1, 2015
@yorkerlin
Copy link
Member Author

@karlnapf
take a look at this

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6e43637 on yorkerlin:inference into * on shogun-toolbox:develop*.

@@ -75,6 +75,7 @@ void CInferenceMethod::init()
SG_ADD((CSGObject**)&m_mean, "mean_function", "Mean function", MS_AVAILABLE);
SG_ADD((CSGObject**)&m_labels, "labels", "Labels", MS_NOT_AVAILABLE);
SG_ADD((CSGObject**)&m_features, "features", "Features", MS_NOT_AVAILABLE);
SG_ADD(&m_is_compute_gradients, "is_compute_gradients", "whether gradients are computed", MS_NOT_AVAILABLE);
Copy link
Member

Choose a reason for hiding this comment

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

why is the field called "is" ?

what about "m_compute_gradients?

Minor "Whether gradients are computed" (capital W)

@karlnapf
Copy link
Member

karlnapf commented May 4, 2015

It is good to have this option.
BUT:

  • I don't like that users have to think about this
  • Gradients should be computed if model-selection is performed and otherwise not
  • without the user interacting
  • If users explicitly asks for gradients, should be computed lazily
  • So the setter for the flag is not the most elegant way to do all this

Thoughts?

@yorkerlin
Copy link
Member Author

for lazy update, it is related to this
#2838

the fact is in SGObject
The hash value is changed if parameter_hash_changed() is called even when values of variables in the object remain unchanged.

for lazy update, I need
No matter how many times parameter_hash_changed() is called, the hash value is unchanged if values of variables in the object remain unchanged.

@yorkerlin
Copy link
Member Author

@karlnapf
the idea using lazy update is at #2839

I close this PR.

@yorkerlin yorkerlin closed this May 5, 2015
@karlnapf
Copy link
Member

karlnapf commented May 7, 2015

Ok, please do the lazy one after the bugfix. We dont want users to need to be explicit about this

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.

None yet

3 participants