Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QcmpCompressionLibrary
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioinformaticDataCompression
QcmpCompressionLibrary
Commits
3c15ae4a
Commit
3c15ae4a
authored
4 years ago
by
Vojtech Moravec
Browse files
Options
Downloads
Patches
Plain Diff
Add commented out smape metric.
parent
6e2eceac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/cz/it4i/qcmp/cli/functions/MeasurePlaneErrorFunction.java
+11
-2
11 additions, 2 deletions
...cz/it4i/qcmp/cli/functions/MeasurePlaneErrorFunction.java
src/main/java/cz/it4i/qcmp/cli/functions/PlaneError.java
+0
-25
0 additions, 25 deletions
src/main/java/cz/it4i/qcmp/cli/functions/PlaneError.java
with
11 additions
and
27 deletions
src/main/java/cz/it4i/qcmp/cli/functions/MeasurePlaneErrorFunction.java
+
11
−
2
View file @
3c15ae4a
...
@@ -123,17 +123,26 @@ public class MeasurePlaneErrorFunction extends CustomFunctionBase {
...
@@ -123,17 +123,26 @@ public class MeasurePlaneErrorFunction extends CustomFunctionBase {
final
OutputStreamWriter
reportWriter
)
throws
IOException
{
final
OutputStreamWriter
reportWriter
)
throws
IOException
{
final
int
[][]
testData
=
loadPlanes
(
testFile
,
ReferenceFileDimensions
);
final
int
[][]
testData
=
loadPlanes
(
testFile
,
ReferenceFileDimensions
);
final
int
pixelCount
=
ReferenceFileDimensions
.
getNumberOfElementsInDimension
(
2
);
reportWriter
.
write
(
"=========================================\n"
);
reportWriter
.
write
(
"=========================================\n"
);
reportWriter
.
write
(
testFile
);
reportWriter
.
write
(
testFile
);
reportWriter
.
write
(
'\n'
);
reportWriter
.
write
(
'\n'
);
reportWriter
.
write
(
"=========================================\n"
);
reportWriter
.
write
(
"=========================================\n"
);
reportWriter
.
write
(
"PlaneIndex;ErrorSum;MeanError\n"
);
reportWriter
.
write
(
"PlaneIndex;ErrorSum;MeanError\n"
);
//;SMAPE
final
int
planePixelCount
=
ReferenceFileDimensions
.
getNumberOfElementsInDimension
(
2
);
final
int
planePixelCount
=
ReferenceFileDimensions
.
getNumberOfElementsInDimension
(
2
);
final
int
[]
diffData
=
new
int
[
planePixelCount
];
final
int
[]
diffData
=
new
int
[
planePixelCount
];
for
(
int
plane
=
0
;
plane
<
ReferenceFileDimensions
.
getPlaneCount
();
plane
++)
{
for
(
int
plane
=
0
;
plane
<
ReferenceFileDimensions
.
getPlaneCount
();
plane
++)
{
// NOTE(Moravec): SMAPE metric. https://en.wikipedia.org/wiki/Symmetric_mean_absolute_percentage_error
// double numerator = 0;
// double denominator = 0;
// for (int i = 0; i < pixelCount; i++) {
// numerator += Math.abs((double) testData[plane][i] - (double) referenceData[plane][i]);
// denominator += ((double) referenceData[plane][i] + (double) testData[plane][i]);
// }
// assert (denominator != 0) : "SMAPE denominator can't be zero.";
// final double SMAPE = numerator / denominator;
Utils
.
differenceToArray
(
referenceData
[
plane
],
testData
[
plane
],
diffData
);
Utils
.
differenceToArray
(
referenceData
[
plane
],
testData
[
plane
],
diffData
);
Utils
.
applyAbsFunction
(
diffData
);
Utils
.
applyAbsFunction
(
diffData
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cz/it4i/qcmp/cli/functions/PlaneError.java
deleted
100644 → 0
+
0
−
25
View file @
6e2eceac
package
cz.it4i.qcmp.cli.functions
;
public
class
PlaneError
{
private
final
int
planeIndex
;
private
final
double
absoluteError
;
private
final
double
meanAbsoluteError
;
public
PlaneError
(
final
int
planeIndex
,
final
double
absoluteError
,
final
double
meanAbsoluteError
)
{
this
.
planeIndex
=
planeIndex
;
this
.
absoluteError
=
absoluteError
;
this
.
meanAbsoluteError
=
meanAbsoluteError
;
}
public
int
getPlaneIndex
()
{
return
planeIndex
;
}
public
double
getAbsoluteError
()
{
return
absoluteError
;
}
public
double
getMeanAbsoluteError
()
{
return
meanAbsoluteError
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment