def build_model(): l_in = nn.layers.InputLayer(( None, n_candidates_per_patient, ) + p_transform['patch_size']) l_in_rshp = nn.layers.ReshapeLayer(l_in, ( -1, 1, ) + p_transform['patch_size']) l_target = nn.layers.InputLayer((batch_size, )) penultimate_layer = load_pretrained_model(l_in_rshp) l = nn.layers.DenseLayer(penultimate_layer, num_units=1, W=nn.init.Orthogonal(), nonlinearity=nn.nonlinearities.sigmoid, name='dense_p_benign') l = nn.layers.ReshapeLayer(l, (-1, n_candidates_per_patient, 1), name='reshape2patients') l_out = nn_lung.LogMeanExp(l, r=8, axis=(1, 2), name='LME') return namedtuple('Model', ['l_in', 'l_out', 'l_target'])(l_in, l_out, l_target)
def build_model(): l_in = nn.layers.InputLayer(( None, n_candidates_per_patient, ) + p_transform['patch_size']) l_in_rshp = nn.layers.ReshapeLayer(l_in, ( -1, 1, ) + p_transform['patch_size']) l_target = nn.layers.InputLayer((batch_size, )) l = load_pretrained_model(l_in_rshp) #ins = penultimate_layer.output_shape[1] # l = conv3d(penultimate_layer, ins, filter_size=3, stride=2) # #l = feat_red(l) # # # l = nn.layers.DropoutLayer(l) # # # l = nn.layers.DenseLayer(l, num_units=256, W=nn.init.Orthogonal(), # nonlinearity=nn.nonlinearities.rectify) #l = nn.layers.DropoutLayer(l) l = nn.layers.ReshapeLayer(l, (-1, n_candidates_per_patient, 1)) l_out = nn_lung.LogMeanExp(l, r=16, axis=(1, 2), name='LME') return namedtuple('Model', ['l_in', 'l_out', 'l_target'])(l_in, l_out, l_target)
def build_model(): l_in = nn.layers.InputLayer((batch_size, n_candidates_per_patient, ) + p_transform['patch_size']) l_in_rshp = nn.layers.ReshapeLayer(l_in, (-1, 1,) + p_transform['patch_size']) l_target = nn.layers.InputLayer((batch_size,)) print l_in_rshp.output_shape feat_layer = load_pretrained_model(l_in_rshp) l = nn.layers.ReshapeLayer(feat_layer, (-1, n_candidates_per_patient), name='reshape2patients') l_out = nn_lung.LogMeanExp(l, r=8, axis=(1,), name='LME') return namedtuple('Model', ['l_in', 'l_out', 'l_target'])(l_in, l_out, l_target)
def build_model(): l_in = nn.layers.InputLayer((None, n_candidates_per_patient, 1,) + p_transform['patch_size']) l_in_rshp = nn.layers.ReshapeLayer(l_in, (-1, 1,) + p_transform['patch_size']) l_target = nn.layers.InputLayer((batch_size,)) penultimate_layer = load_pretrained_model(l_in_rshp) l = drop(penultimate_layer, name='drop_final') l = dense(l, 512, name='dense_final') l = nn.layers.DenseLayer(l, num_units=1, W=nn.init.Orthogonal(), nonlinearity=None, name='dense_p_benign') l = nn.layers.ReshapeLayer(l, (-1, n_candidates_per_patient, 1), name='reshape2patients') l_out = nn_lung.LogMeanExp(l, name='aggregate_all_nodules_benign') return namedtuple('Model', ['l_in', 'l_out', 'l_target'])(l_in, l_out, l_target)