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

Use iterative machine mixin in more algorithms #4488

Open
shubham808 opened this issue Jan 25, 2019 · 14 comments
Open

Use iterative machine mixin in more algorithms #4488

shubham808 opened this issue Jan 25, 2019 · 14 comments

Comments

@shubham808
Copy link
Contributor

shubham808 commented Jan 25, 2019

This is a very good issue for those who want to be involved in the project inside the black box II

In order to make algorithms stoppable, we need to execute each iteration and then save the state in member variables. If a user decides to stop the process at any iteration, control is returned back. This means the user is free to continue, serialize, test etc. on the pre-trained model
See Perceptron and NewtonSVM as examples.
We want all iterative algorithms to apply this mixin

First Steps

  • Identify the initialization and iteration phase(what occurs in the training loop) of the algorithm
  • The initialization part (mostly above the training loop) goes into the init_model() method
  • The iteration function will implement a single iteration of the algorithm, so we will move the contents of the training loop into iteration function
  • Create new member variables if required to share data between init_model and iteration
  • Delete local copies of variables that represent state(like weights and bias)
  • Finally write tests to see if everything is consistent :) see NewtonSVM unit tests and Perceptron unit tests

Initially we want this done for a single Linear Machine algorithm (CAveragedPerceptron is a good place to start)
See the iterative machine guide for more information

@souvik3333
Copy link

Hi @shubham808, I am new here. I read the wiki for inside the black box II project and I am really interested to work on it. This issue would be a great introduction to the project. So, Can I work on this?

@shubham808
Copy link
Contributor Author

Yes go ahead :)

@han0305
Copy link

han0305 commented Mar 9, 2019

I am new to open source and I will like to work on this issue.

@samdbrice
Copy link

I this issue closed as per the Merge on Mar 2?

@karlnapf
Copy link
Member

karlnapf commented Jul 9, 2019

Nope, still lots of iterative algorithms/machines to port

@samdbrice
Copy link

Ah ok, so this is akin to a Milestone/Sticky issue - not a one-off item. This is indeed a good first issue, I'll see if I can implement one.

@karlnapf
Copy link
Member

karlnapf commented Jul 9, 2019

Just checked a few machines that are iterative and realised that most low hanging fruits have been taken. There are quite a few algorithms to port left but the changes will be slightly more nontrivial. Everything that is based on (stochastic) gradient descent is worth looking into here

@progmatic-99
Copy link

I would like to contribute. Is there any work left to be done in this issue?

@ashutosh-b-b
Copy link

Hi. If this is still open can I take up this one?

@sbrice
Copy link

sbrice commented Jan 17, 2020

Sure, go for it. Thanks!

@ashutosh-b-b
Copy link

@samdbrice I did started to read the blog and understand it. Which algorithm should I go with knowing that I am a beginner here?

@ashutosh-b-b
Copy link

I was thinking to start with Brute KNN can anyone guide me?

@vigsterkr
Copy link
Member

@ashutosh-b-b you could start with that or with https://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/metric/LMNN.cpp basically the idea is that you follow the CRTP pattern with IterativeMachine and move an iteration to logic into iteration function

@ashutosh-b-b
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants