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

add progress bar to FastICA #4234

Merged
merged 2 commits into from Apr 18, 2018

Conversation

sunalbert
Copy link
Contributor

add progress bar to FastICA algorithm.

@sunalbert sunalbert changed the title ad progress bar to FastICA add progress bar to FastICA Apr 6, 2018
@sunalbert
Copy link
Contributor Author

The code is based on Advanced usage of progress bar . Comments are greatly appreciated.

float64_t lim = tol+1;
while (lim > tol && iter < max_iter)
for (auto i : progress(
range(0, max_iter), "PROGRESS: ", UTF8, [&] { return lim > tol; }))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor, for consistency, indent and break lines like in the doc reference you've cited.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @iglesias . The style has been modified.

@iglesias
Copy link
Collaborator

iglesias commented Apr 8, 2018

Sorry that I did not mention it earlier, I have noticed only now the number of commits. Can you squash the 4 into 1? Thanks!

@@ -130,7 +130,11 @@ CFeatures* CFastICA::apply(CFeatures* features)

float64_t lim = tol+1;
for (auto i : progress(
range(0, max_iter), "PROGRESS: ", UTF8, [&] { return lim > tol; }))
range(0, max_iter),
"PROGRESS: ",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Put this line and the two below at the same indentation than range, like in the doc we were referring to.

@sunalbert
Copy link
Contributor Author

sunalbert commented Apr 8, 2018

Thanks @iglesias I have changed the code style and squashed all the commits into one.

@karlnapf
Copy link
Member

karlnapf commented Apr 9, 2018

@iglesias we can now squash with github, so people can just keep on adding commits to PRs (better to see trajectory, history, and preserving discussions (at least for small changes that make sense to group into a single commit)

while (lim > tol && iter < max_iter)
for (auto i : progress(
range(0, max_iter),
"PROGRESS: ",
Copy link
Member

Choose a reason for hiding this comment

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

@geektoni this seems a bit verbose. Isnt there a shorter version?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry! I just only realise this is the advanced way of using it

Copy link
Member

Choose a reason for hiding this comment

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

@geektoni Could we have a way to pass lambda functions that does not require to pass the string and the encoding?
I.e. something as compact as the for (auto i: progress(range(0, 10))) but with a custom stopping condition?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure! That's totally feasible. I should be able to make a patch for it later today.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@sunalbert could you rebase and use the new function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, Thanks @iglesias @karlnapf

Copy link
Collaborator

Choose a reason for hiding this comment

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

Of course, you are welcome!

modify code style

fix style error automatically

finetune the code style

modify the code style again
@sunalbert
Copy link
Contributor Author

Hi, all, sorry to disturb you guys again. I can not reproduce the problem in the local version. Any tips to fix the issues?

@karlnapf
Copy link
Member

All good the error is not caused by you

@karlnapf karlnapf merged commit 208369a into shogun-toolbox:develop Apr 18, 2018
@sunalbert sunalbert deleted the feature/add_pd_for_fastICA branch April 20, 2018 02:56
ktiefe pushed a commit to ktiefe/shogun that referenced this pull request Jul 30, 2019
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

4 participants