Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
d9ea7668
Commit
d9ea7668
authored
Jul 27, 2018
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing infinity values
parent
3476fe17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
MLStats.java
src/main/java/MLStats.java
+22
-7
No files found.
src/main/java/MLStats.java
View file @
d9ea7668
...
...
@@ -216,7 +216,7 @@ public class MLStats {
if
(
nTile1
>=
0
)
{
d
=
dsi_float
[
0
][
nTile1
];
s
=
dsi_float
[
1
][
nTile1
]
-
strength_min_drop
;
if
(
s
>
0.0
)
{
if
(
(
s
>
0.0
)
&&
(
s
<=
strength_max_drop
))
{
// s was infinity here!
sm
=
dsi_float
[
3
][
nTile1
]
-
master_weight_floor
;
if
(
sm
>
0.0
)
{
double
de
=
dsi_float
[
2
][
nTile1
]
-
d
;
...
...
@@ -229,17 +229,29 @@ public class MLStats {
w
=
Math
.
pow
(
w
,
master_weight_power
);
}
}
if
(!
((
w
>
0.0
)
&&
(
w
<
1.0
))){
System
.
out
.
println
(
"strange w="
+
w
);
}
w
*=
dir_weights
[
direction
&
1
]
*
s
;
//
sw
+=
w
;
sew
+=
w
*
de
;
if
(
Double
.
isInfinite
(
w
)){
System
.
out
.
println
(
Double
.
isInfinite
(
w
));
}
}
}
}
}
}
// sew /= sw;
ds_error
[
dbin
][
sbin
][
2
]
+=
sew
*
sew
/
sw
;
ds_error
[
dbin
][
sbin
][
3
]
+=
sw
;
if
(
sw
>
0.0
)
{
ds_error
[
dbin
][
sbin
][
2
]
+=
sew
*
sew
/
sw
;
ds_error
[
dbin
][
sbin
][
3
]
+=
sw
;
if
(
Double
.
isNaN
(
ds_error
[
dbin
][
sbin
][
2
]))
{
System
.
out
.
println
(
"Double.isNaN(ds_error[dbin][sbin][2])"
);
}
}
}
}
}
...
...
@@ -345,10 +357,13 @@ public class MLStats {
for
(
int
sbin
=
0
;
sbin
<
strength_bins
;
sbin
++)
{
int
nTile
=
dbin
+
sbin
*
disparity_bins
;
if
(
ds_mask
[
nTile
])
{
sew
+=
ds_error
[
dbin
][
sbin
][
0
];
sw
+=
ds_error
[
dbin
][
sbin
][
1
];
sew9
+=
ds_error
[
dbin
][
sbin
][
2
];
sw9
+=
ds_error
[
dbin
][
sbin
][
3
];
sew
+=
ds_error
[
dbin
][
sbin
][
0
]
*
sbin
;
// * strength_step);
sw
+=
ds_error
[
dbin
][
sbin
][
1
]
*
sbin
;
sew9
+=
ds_error
[
dbin
][
sbin
][
2
]
*
sbin
;
sw9
+=
ds_error
[
dbin
][
sbin
][
3
]
*
sbin
;
if
(
Double
.
isNaN
(
sew9
))
{
System
.
out
.
println
(
"Double.isNaN(sew9)"
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment