August 2018
Intermediate to advanced
272 pages
7h 2m
English
Once the model is defined, model = CAE_CNN_Encoder(), it is important to select layers that will be initialized with pretrained weights. Pay attention that the structure of both networks, the one to be initialized and the one that gives the trained weights, must be the same. So, for example, the following snippet of code will select all layers with name convs of fc:
from models import CAE_CNN_Encoder model = CAE_CNN_Encoder()list_convs = [v for v in tf.global_variables() if "conv" in v.name]list_fc_linear = [v for v in tf.global_variables() if "fc" in v.name or "output" in v.name]
Note that those lists are populated from tf.global_variables(); if we choose to print its content, we might observe that it holds all the model ...
Read now
Unlock full access