SoftMax extends BaseActivationFunction { public SoftMax(boolean rows) { this.rows = rows; } SoftMax(boolean rows);  SoftMax(); static INDArray softmax(INDArray input,boolean row); @Override INDArray apply(INDArray input); @Override Class<? extends ElementWiseOp> transformClazz(); @Override INDArray applyDerivative(INDArray input);  }
@Test public void testSoftMax() { Nd4j.factory().setOrder('f'); INDArray test = Nd4j.linspace(1, 6, 6).reshape(2,3); INDArray softMaxColumns = Activations.softmax().apply(test); INDArray softMaxRows = Activations.softMaxRows().apply(test); INDArray columns = softMaxColumns.sum(0); INDArray rows = softMaxRows.sum(1); assertEquals(3,columns.sum(Integer.MAX_VALUE).getFloat(0),1e-1); assertEquals(2,rows.sum(Integer.MAX_VALUE).getFloat(0),1e-1); }