Monday, December 16, 2019

Neural Network Classifiers


DeleteObject[images];
images=ResourceObject["CIFAR-10"]
train=RandomSample[ResourceData[images],5000];

RandomSample[train,5]
classes=Union@Values[train]


NN= NetChain[{ConvolutionLayer[32,5],Ramp, PoolingLayer[2,2],
ConvolutionLayer[96,5],Ramp, PoolingLayer[2,2],
FlattenLayer[],512,Ramp,10,SoftmaxLayer[]},
"Output" -> NetDecoder[{"Class",classes}],
"Input" -> NetEncoder[{"Image",{32,32}}]]

NNTrained = NetTrain[NN,train,MaxTrainingRounds -> 5]


No comments:

Post a Comment