I have a sample of images of chairs and tables and I want to use a neural network using convolutional layer and gpu-acceleration for training. This is what I have so far - how do I train the network?
chairs = Import["C:\\Users\\Murphy\\Samples\\chairs\\*"];
tables = Import["C:\\Users\\Murphy\\Samples\\tables\\*"];
$train = 300;
trainingData = <|"Chairs" -> chairs[[;; $train]], "Tables" -> tables[[;;$train]]|>;
testingData = <|"Chairs" -> chairs[[$train + 1 ;;]], "Tables" -> tables[[$train + 1 ;;]]|>;
module = NetChain[{ ConvolutionLayer[100, {3, 3}], BatchNormalizationLayer[], ElementwiseLayer[Ramp], PoolingLayer[{3, 3}, "PaddingSize" -> 1] }]
net = NetChain[{ module, module, module, module, FlattenLayer[], 500, Ramp, 10, SoftmaxLayer[]}, "Input" -> NetEncoder[{"Image", {32, 32}}], "Output" -> NetDecoder[{"Class", classes}]]
{time, trained} = AbsoluteTiming @ NetTrain[net, trainingData, TargetDevice -> "GPU"];
Classify
? That would be a reasonable place to start. $\endgroup$NetModel
and google transfer learning $\endgroup$