From this nice answer one can import pretrained NN models and structures for state of art models.
URLDownload[
"http://data.dmlc.ml/mxnet/models/imagenet/inception-v3.tar.gz",
FileNameJoin[{$UserDocumentsDirectory, "inception-v3.tar.gz"}]
];
ExtractArchive["inception-v3.tar.gz"];
Needs["NeuralNetworks`"]
net = NeuralNetworks`ImportMXNetModel[
"model//Inception-7-symbol.json",
"model//Inception-7-0001.params"
]
The returned result is NetGraph object. In this object, imported models uses NetPort for inputs, as a result one must enter tensor with given dimensions. However, Mathematica has some nice encoders:
enc = NetEncoder[{"Image", {150, 150}}]
My question:
Is it possible to change ports inputting tensors to these Mathematica defined encoders? If so, how?
Upadate:
In addition, I would like to know if it's possible in the inception model to change the number of output classes. Currently, I want to use the structure but not pretrained model with 1008 classes. Lets say I want 10 new classes for output. How can I modify DotPlusLayer("fc1"), SoftMaxLayer("softmax") and Port "Output" for this 10 classes?