O'Reilly logo

Hands-On Machine Learning with C# by Matt R. Cole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Function stacks

Function stacks are layers of functions that are executed simultaneously in one forward, backward, or update pass. Function stacks are created when you either create a test or load a model from disk. Here are some examples of function stacks.

They can be small and simple:

FunctionStack nn = new FunctionStack(                 new Linear(2, 2, name: "l1 Linear"),                 new Sigmoid(name: "l1 Sigmoid"),                 new Linear(2, 2, name: "l2 Linear"));

They can be a little bit bigger:

FunctionStack nn = new FunctionStack(                 new Convolution2D(1, 2, 3, name: "conv1", gpuEnable: true),// Do not forget the GPU flag if necessary                 new ReLU(),                 new MaxPooling(2, 2),                 new Convolution2D(2, 2, 2, name: "conv2", gpuEnable: true),                 new ReLU(),                 new MaxPooling(2, 2), new Linear(8, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required