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
Generic CSGObject methods #4432
Conversation
I think the mentioned method can be dropped. As for the filter, I would just use the existing Then we can have special API sugar for things like hyper-parameters, things that might be needed frequently by users Since we are changing APIs all the time anyways atm (need to do a new release soon), we can definitely try to make this as clean as possible via dropping old things and chose appropriate names and patterns |
@@ -90,6 +90,17 @@ namespace shogun | |||
return map.find(tag) != map.end(); | |||
} | |||
|
|||
ParametersMap filter(ParameterProperties pprop) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this just as an internal filter method?
Sounds like a good idea to me!
Merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stuff like this should though be hidden from outside (as done here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, should work fine, just need to write a test for it!
Ah ok! So drop the |
I would drop print, see other thread. |
Actually I would name them
|
"names" is redundant when we return a string list |
Drop :)
On Thu, 13 Dec 2018 at 13:25, Gil ***@***.***> wrote:
Ah ok! So drop the get_modelsel_names and have a filter-able
parameter_names? What about the print_*, that is still useful right and
should be refactored no?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4432 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAqqv0aQIdcSuFJ6yO4EyylwdZEbswbSks5u4kdBgaJpZM4ZRc19>
.
--
Sent from my phone
|
OK! That makes sense! |
I am thinking if it makes sense to change |
I think there might be a problem as properties then might contradict, i.e. NONE and something else is set. |
I am not sure I understand what you mean with "Those summarising property states are better computed on the fly imo" |
Sorry :) |
OK! I am just thinking how a user can find several masks at once, including NONE. If NONE is 0, then a user would need to find NONE specifically and then find any other flag separately. Maybe a bit of code explains this better than I can.
but that isn't possible with the current design. Right now we would need this:
On the other hand this is possible:
Maybe I am thinking about the API design differently to as what it is intended to be? |
I realise now that indeed this does not make any sense. But making NONE nonzero also doesnt make sense (due to semantical conflicts when NONE and other flags are set). |
Closing this in favour of |
Now that all model parameters are stored in the same map and are aware of their function in the ML algorithms we can use this to have more generic getters that use
AnyParameterProperties
. In other words, can start replacing things likeCSGObject::get_modelsel_names
with a genericCSGObject::get_names(ParameterProperties pprop)
, which can be used for hyperparameters, gradients, and so on.I think the best is to filter the
ParametersMap
with afilter
method insideself
and then use this inside each getter.