This is the benchmark i can run over the COMMAND LINE with "java -jar target/benchmarks.jar":
public class MyBenchmark {
@Benchmark
public void testMethod() throws IOException {
Logger log = LoggerFactory.getLogger(MyBenchmark.class);
//number of rows and columns in the input pictures
final int numRows = 28;
final int numColumns = 28;
int outputNum = 10; // number of output classes
int batchSize = 64; // batch size for each epoch
int rngSeed = 123; // random number seed for reproducibility
int numEpochs = 15; // number of epochs to perform
double rate = 0.0015; // learning rate
//Get the DataSetIterators:
DataSetIterator mnistTrain = new MnistDataSetIterator(batchSize, true, rngSeed);
DataSetIterator mnistTest = new MnistDataSetIterator(batchSize, false, rngSeed);
log.info("Build model....");
File locationToSave = new File("dasGespModell.zip");
MultiLayerNetwork model = ModelSerializer.restoreMultiLayerNetwork(locationToSave);
model.init();
//model.setListeners(new ScoreIterationListener(5)); //print the score with every iteration
log.info("Evaluate model....");
Evaluation eval = model.evaluate(mnistTest);
log.info(eval.stats());
log.info("****************Example finished********************");
}
}
But I want to measure this code explicit on my GPU and my CPU and this is only possible, when I change the dependencies in my pom.xml and run the code when pushing the run button and not putting "java -jar target/benchmarks.jar" in the terminal.
Any ideas?