Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PixelRep
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
PixelRep
Commits
16eddea3
There was a problem fetching the pipeline summary.
Commit
16eddea3
authored
Jul 23, 2016
by
Walt Mankowski
Browse files
Options
Downloads
Patches
Plain Diff
more debugging of broken thread code
parent
228b55bc
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
srcx/ImageJ/Demo_Pixel_Replication_Threads.java
+16
-6
16 additions, 6 deletions
srcx/ImageJ/Demo_Pixel_Replication_Threads.java
with
16 additions
and
6 deletions
srcx/ImageJ/Demo_Pixel_Replication_Threads.java
+
16
−
6
View file @
16eddea3
...
@@ -9,6 +9,7 @@ import java.nio.FloatBuffer;
...
@@ -9,6 +9,7 @@ import java.nio.FloatBuffer;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Random
;
import
java.util.Random
;
import
java.time.LocalTime
;
import
static
org
.
bytedeco
.
javacpp
.
opencv_core
.*;
import
static
org
.
bytedeco
.
javacpp
.
opencv_core
.*;
import
static
org
.
bytedeco
.
javacpp
.
opencv_imgproc
.*;
import
static
org
.
bytedeco
.
javacpp
.
opencv_imgproc
.*;
...
@@ -65,16 +66,17 @@ public class Demo_Pixel_Replication_Threads implements PlugInFilter {
...
@@ -65,16 +66,17 @@ public class Demo_Pixel_Replication_Threads implements PlugInFilter {
Mat
initMeans
=
randomInitMeans
(
k
);
Mat
initMeans
=
randomInitMeans
(
k
);
IJ
.
log
(
String
.
format
(
"thread %d em randomInitMeans();"
,
idx
));
IJ
.
log
(
String
.
format
(
"thread %d em randomInitMeans();"
,
idx
));
synchronized
(
lock1
)
{
//
synchronized(lock1) {
// try {
// try {
IJ
.
log
(
String
.
format
(
"before, thread %d, trained "
,
idx
)
+
em
.
isTrained
());
// IJ.log(String.format("before, thread %d, trained ", idx) + em.isTrained());
em
.
trainE
(
emMat
,
initMeans
,
new
Mat
(),
new
Mat
(),
logLikelihoods
,
labels
,
new
Mat
());
// em.trainE(emMat, initMeans, new Mat(), new Mat(), logLikelihoods, labels, new Mat());
IJ
.
log
(
String
.
format
(
"after, thread %d, trained "
,
idx
)
+
em
.
isTrained
());
train
(
em
,
emMat
,
initMeans
,
new
Mat
(),
new
Mat
(),
logLikelihoods
,
labels
,
new
Mat
());
// IJ.log(String.format("after, thread %d, trained ", idx) + em.isTrained());
// } catch (Exception e) {
// } catch (Exception e) {
// IJ.log("Caught exception in em.trainE: " + e.getMessage());
// IJ.log("Caught exception in em.trainE: " + e.getMessage());
// }
// }
}
//
}
IJ
.
log
(
String
.
format
(
"thread %d em em.trainE();"
,
idx
));
//
IJ.log(String.format("thread %d em em.trainE();", idx));
synchronized
(
lock2
)
{
synchronized
(
lock2
)
{
ems
[
idx
]
=
em
;
ems
[
idx
]
=
em
;
...
@@ -82,6 +84,14 @@ public class Demo_Pixel_Replication_Threads implements PlugInFilter {
...
@@ -82,6 +84,14 @@ public class Demo_Pixel_Replication_Threads implements PlugInFilter {
}
}
IJ
.
log
(
String
.
format
(
"replicate %d score = %f"
,
idx
,
em_scores
[
idx
]));
IJ
.
log
(
String
.
format
(
"replicate %d score = %f"
,
idx
,
em_scores
[
idx
]));
}
}
public
synchronized
void
train
(
EM
em
,
Mat
emMat
,
Mat
initMeans
,
Mat
tmp1
,
Mat
tmp2
,
Mat
logLikelihoods
,
Mat
labels
,
Mat
tmp3
)
{
IJ
.
log
(
String
.
format
(
"%s before, thread %d, trained "
,
LocalTime
.
now
(),
idx
)
+
em
.
isTrained
());
em
.
trainE
(
emMat
,
initMeans
,
new
Mat
(),
new
Mat
(),
logLikelihoods
,
labels
,
new
Mat
());
IJ
.
log
(
String
.
format
(
"%s after, thread %d, trained "
,
LocalTime
.
now
(),
idx
)
+
em
.
isTrained
());
IJ
.
log
(
String
.
format
(
"%s thread %d em em.trainE();"
,
LocalTime
.
now
(),
idx
));
}
}
}
public
Demo_Pixel_Replication_Threads
()
{
public
Demo_Pixel_Replication_Threads
()
{
...
...
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