// Add the snapshot repository to get the DJL snapshot artifacts // %mavenRepo snapshots https://oss.sonatype.org/content/repositories/snapshots/ // Add the maven dependencies %maven ai.djl:api:0.11.0 %maven org.slf4j:slf4j-api:1.7.26 %maven org.slf4j:slf4j-simple:1.7.26 // See https://github.com/deepjavalibrary/djl/blob/master/mxnet/mxnet-engine/README.md // for more MXNet library selection options %maven ai.djl.mxnet:mxnet-native-auto:1.8.0 import ai.djl.*; import ai.djl.nn.*; import ai.djl.nn.core.*; import ai.djl.training.*; Application application = Application.CV.IMAGE_CLASSIFICATION; long inputSize = 28*28; long outputSize = 10; SequentialBlock block = new SequentialBlock(); block.add(Blocks.batchFlattenBlock(inputSize)); block.add(Linear.builder().setUnits(128).build()); block.add(Activation::relu); block.add(Linear.builder().setUnits(64).build()); block.add(Activation::relu); block.add(Linear.builder().setUnits(outputSize).build()); block