Build a denseblock where the output of each conv_factory is fed to subsequent ones :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 to the model. :param nb
(x, concat_axis, nb_layers, nb_filter, growth_rate,
dropout_rate=None, weight_decay=1E-4)
| 70 | |
| 71 | |
| 72 | def denseblock(x, concat_axis, nb_layers, nb_filter, growth_rate, |
| 73 | dropout_rate=None, weight_decay=1E-4): |
| 74 | """Build a denseblock where the output of each |
| 75 | conv_factory is fed to subsequent ones |
| 76 | |
| 77 | :param x: keras model |
| 78 | :param concat_axis: int -- index of contatenate axis |
| 79 | :param nb_layers: int -- the number of layers of conv_ |
| 80 | factory to append to the model. |
| 81 | :param nb_filter: int -- number of filters |
| 82 | :param dropout_rate: int -- dropout rate |
| 83 | :param weight_decay: int -- weight decay factor |
| 84 | |
| 85 | :returns: keras model with nb_layers of conv_factory appended |
| 86 | :rtype: keras model |
| 87 | |
| 88 | """ |
| 89 | |
| 90 | list_feat = [x] |
| 91 | |
| 92 | for i in range(nb_layers): |
| 93 | x = conv_factory(x, concat_axis, growth_rate, |
| 94 | dropout_rate, weight_decay) |
| 95 | list_feat.append(x) |
| 96 | x = Concatenate(axis=concat_axis)(list_feat) |
| 97 | nb_filter += growth_rate |
| 98 | |
| 99 | return x, nb_filter |
| 100 | |
| 101 | |
| 102 | def denseblock_altern(x, concat_axis, nb_layers, nb_filter, growth_rate, |
no test coverage detected