use of deepboof.impl.forward.standard.FunctionLinear_F32 in project BoofCV by lessthanoptimal.
the class CheckBaseImageClassifier method createDummyNetwork.
private void createDummyNetwork(BaseImageClassifier alg, int width, int height) {
for (int i = 0; i < numCategories; i++) {
alg.getCategories().add("Category " + i);
}
FunctionLinear_F32 function = new FunctionLinear_F32(numCategories);
function.initialize(3, height, width);
List<Tensor_F32> parameters = new ArrayList<>();
parameters.add(TensorFactory_F32.random(rand, false, function.getParameterShapes().get(0)));
parameters.add(TensorFactory_F32.random(rand, false, function.getParameterShapes().get(1)));
function.setParameters(parameters);
Node<Tensor_F32, Function<Tensor_F32>> node = new Node<>();
node.function = function;
List<Node<Tensor_F32, Function<Tensor_F32>>> sequence = new ArrayList<>();
sequence.add(node);
alg.network = new FunctionSequence<>(sequence, Tensor_F32.class);
alg.tensorOutput = new Tensor_F32(WI(1, alg.network.getOutputShape()));
}
Aggregations