Skip to content

Changed eps checking condition - #14050

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
npochhi:mlp_ann_eps_change
Mar 14, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
npochhi:mlp_ann_eps_change

Conversation

@npochhi

@npochhi npochhi commented Mar 13, 2019

Copy link
Copy Markdown
Contributor

resolves #13946

Changed the epsilon assigning condition. Initially, epsilon was taking FLOAT_MIN value in case of only COUNT condition, however according to the relevant issue, epsilon checking shouldn't happen.

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for contribution!

As a "bugfix" this patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

Comment thread modules/ml/src/ann_mlp.cpp Outdated
{
//printf("%d. E = %g\n", iter/count, E);
if( fabs(prev_E - E) < epsilon )
if( fabs(prev_E - E) < epsilon && termCrit.type & CV_TERMCRIT_EPS )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe it is better set epsilon to zero during initialization on line 902:

double epsilon = (termCrit.type & TermCriteria::EPS)
        ? termCrit.epsilon*count
        : 0;  // TermCriteria::COUNT

Also it is better to avoid deprecated C-style defines.

@npochhi npochhi Mar 14, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for helping me to contribute. I've changed the code accordingly, please have a look.

@npochhi
npochhi changed the base branch from master to 3.4 March 14, 2019 08:32
@npochhi
npochhi force-pushed the mlp_ann_eps_change branch from 35dba04 to f1a9999 Compare March 14, 2019 08:34
@npochhi
npochhi changed the base branch from 3.4 to master March 14, 2019 08:35
@npochhi
npochhi changed the base branch from master to 3.4 March 14, 2019 08:35

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well done! Thank you 👍

@opencv-pushbot
opencv-pushbot merged commit f1a9999 into opencv:3.4 Mar 14, 2019
@npochhi
npochhi deleted the mlp_ann_eps_change branch March 14, 2019 15:01
@alalek alalek mentioned this pull request Mar 15, 2019
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants