Skip to content

Commit

Permalink
Move AI model from reconstruction/alert to etc/nnet.
Browse files Browse the repository at this point in the history
Use CLASResources class to get the path of the model.
  • Loading branch information
mathieuouillon authored and baltzell committed Jan 10, 2025
1 parent ea80f18 commit 5c6be95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.jlab.rec.ahdc.PreCluster.PreCluster;
import org.jlab.rec.ahdc.PreCluster.PreClusterFinder;
import org.jlab.rec.ahdc.Track.Track;
import org.jlab.utils.CLASResources;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -80,9 +81,10 @@ public NDList processInput(TranslatorContext translatorContext, float[] floats)
return new NDList(samples);
}
};


String path = CLASResources.getResourcePath("etc/nnet/ALERT/model_AHDC/");
Criteria<float[], Float> my_model = Criteria.builder().setTypes(float[].class, Float.class)
.optModelPath(Paths.get(System.getenv("CLAS12DIR") + "/../reconstruction/alert/src/main/java/org/jlab/rec/ahdc/AI/model/"))
.optModelPath(Paths.get(path))
.optEngine("PyTorch")
.optTranslator(my_translator)
.optProgress(new ProgressBar())
Expand Down

0 comments on commit 5c6be95

Please sign in to comment.