build(deps): bump msgpackr from 1.5.5 to 1.10.1 in /tfjs-automl/demo/img_classification
Bumps msgpackr from 1.5.5 to 1.10.1.
Commits
- See full diff in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
That does seem poor... But you are ignoring this warning:
warning: passing floating-point values to sym is dangerous, see "help sym"
Compare the difference between these:
1e-23*x
warning: passing floating-point values to sym is dangerous, see "help sym"
warning: called from
double_to_sym_heuristic at line 50 column 7
sym at line 379 column 13
mtimes at line 54 column 5
ans = (sym)
x
───────────────────
9223372036854775807
octave:28> sym(1)*sym(10)^(-23)*x
ans = (sym)
x
────────────────────────
100000000000000000000000
I'm not sure if this can be improved but the root of this problem is the following. I've hidden most of the warnings, but I re-iterate that converting doubles to sym is a bad idea, that's what the warning is telling us.
> sym(1e-15)
warning: passing floating-point values to sym is dangerous, see "help sym"
ans = (sym) 1/1000000000000000
> sym(1e-16)
warning: passing floating-point values to sym is dangerous, see "help sym"
ans = (sym) 1/10000000000000000
> sym(1e-17)
warning: passing floating-point values to sym is dangerous, see "help sym"
ans = (sym) 1/100000000000000000
> sym(1e-18)
warning: passing floating-point values to sym is dangerous, see "help sym"
ans = (sym) 1/999999999999999872
> sym(1e-19)
warning: passing floating-point values to sym is dangerous, see "help sym"
ans = (sym) 1/9223372036854775807
> sym(1e-20)
warning: passing floating-point values to sym is dangerous, see "help sym"
ans = (sym) 1/9223372036854775807
This 9223372036854775807 number is 2^63 - 1: presumably a int64 is being created somewhere along the way... Python int's have no max but int64 or uint64 certainly do...
Using ratflag as f is working fine:
sym(1e-23, 'f')
ans = (sym)
6805647338418769
───────────────────────────────────────
680564733841876926926749214863536422912
So I tracked this to @sym/private/double_to_sym_heuristic.m:
[N1, D1] = rat (x);
[N2, D2] = rat (x / pi);
N3 = round (x^2);
err1 = abs (N1 / D1 - x);
err2 = abs ((N2*pi) / D2 - x);
err3 = abs (sqrt (N3) - x);
if (err1 <= err3)
if (err1 <= err2)
y = pycall_sympy__ ('return Rational(*_ins)', int64 (N1), int64 (D1));
else
y = pycall_sympy__ ('return Rational(*_ins)*S.Pi', int64 (N2), int64 (D2));
end
else
y = pycall_sympy__ ('return sqrt(Integer(*_ins))', int64 (N3));
end
observations
- Lots of double precision calculations being done there
- none of those
errcalculations are accurate at these scales - values being passed are limited to int64
decisions to be made
- since its a heuristic function, perhaps there should be a hardcoded range where the heuristics are applied...
- outside of that range, either an error or better yet fall back on
ratflag'f' - and/or go back to
rats: IIRC it was worse, but it would give a string.