MCPcopy Create free account
hub / github.com/tdeboissiere/DeepLearningImplementations / denseblock_altern

Function denseblock_altern

DenseNet/densenet.py:102–128  ·  view source on GitHub ↗

Build a denseblock where the output of each conv_factory is fed to subsequent ones. (Alternative of a above) :param x: keras model :param concat_axis: int -- index of contatenate axis :param nb_layers: int -- the number of layers of conv_ factory to append t

(x, concat_axis, nb_layers, nb_filter, growth_rate,
                      dropout_rate=None, weight_decay=1E-4)

Source from the content-addressed store, hash-verified

100
101
102def denseblock_altern(x, concat_axis, nb_layers, nb_filter, growth_rate,
103 dropout_rate=None, weight_decay=1E-4):
104 """Build a denseblock where the output of each conv_factory
105 is fed to subsequent ones. (Alternative of a above)
106
107 :param x: keras model
108 :param concat_axis: int -- index of contatenate axis
109 :param nb_layers: int -- the number of layers of conv_
110 factory to append to the model.
111 :param nb_filter: int -- number of filters
112 :param dropout_rate: int -- dropout rate
113 :param weight_decay: int -- weight decay factor
114
115 :returns: keras model with nb_layers of conv_factory appended
116 :rtype: keras model
117
118 * The main difference between this implementation and the implementation
119 above is that the one above
120 """
121
122 for i in range(nb_layers):
123 merge_tensor = conv_factory(x, concat_axis, growth_rate,
124 dropout_rate, weight_decay)
125 x = Concatenate(axis=concat_axis)([merge_tensor, x])
126 nb_filter += growth_rate
127
128 return x, nb_filter
129
130
131def DenseNet(nb_classes, img_dim, depth, nb_dense_block, growth_rate,

Callers

nothing calls this directly

Calls 1

conv_factoryFunction · 0.85

Tested by

no test coverage detected