Hi, First of all i apologize if this question has already been answered but i am unable to find a solution hence i am asking. I have been trying to build a CNN to classify the MNIST dataset. I have imported the data from local folder and have trained the network. My problem is that i would like to visualize the weights but have been receiving an error. I have tried various sources but have failed to find out what the problem is. Please kindly help me to find out what is wrong with my code.
conv1 = ConvolutionLayer[20, {5, 5}, "PaddingSize" -> 0,
"Stride" -> 1 ];
conv2 = ConvolutionLayer[50, {5, 5}, "PaddingSize" -> 0,
"Stride" -> 1];
block1 = {conv1, Ramp, PoolingLayer[2, 2], conv2, Ramp,
PoolingLayer[2, 2], FlattenLayer[], 500, Ramp, class,
SoftmaxLayer[]};
leNet = NetChain[block1,
"Output" ->
NetDecoder[{"Class", {"0", "1", "2", "3", "4", "5", "6", "7", "8",
"9"}}], "Input" -> NetEncoder[{"Image", {28, 28}, "Grayscale"}]]
trainedNet =
NetTrain[leNet, trainingData, ValidationSet -> testingData,
MaxTrainingRounds -> maxTrainingRounds, BatchSize -> batchSize]
weights = NetExtract[leNet, {"conv1", "Weights"}];
Dimensions[weights]
out = { }
ImageAdjust[Image[#, Interleaving -> False]] & /@ weights
out = Missing["NotPresent", {"conv1", "Weights"}]