From 9c24aed50db289f0fdeedc6e0e69c916a5b66f8f Mon Sep 17 00:00:00 2001 From: Francois Chollet Date: Tue, 9 Jan 2018 16:41:32 -0800 Subject: [PATCH] Formatting fixes in DenseNet --- keras/applications/densenet.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/keras/applications/densenet.py b/keras/applications/densenet.py index f3ae02dd8d1..b4d2313a375 100644 --- a/keras/applications/densenet.py +++ b/keras/applications/densenet.py @@ -1,14 +1,17 @@ # -*- coding: utf-8 -*- """DenseNet models for Keras. -# Reference paper: +# Reference paper -- [Densely Connected Convolutional Networks](https://arxiv.org/abs/1608.06993) (CVPR 2017 Best Paper Award) +- [Densely Connected Convolutional Networks] + (https://arxiv.org/abs/1608.06993) (CVPR 2017 Best Paper Award) -# Reference implementation: +# Reference implementation -- [Torch DenseNets](https://github.com/liuzhuang13/DenseNet/blob/master/models/densenet.lua) -- [TensorNets](https://github.com/taehoonlee/tensornets/blob/master/tensornets/densenets.py) +- [Torch DenseNets] + (https://github.com/liuzhuang13/DenseNet/blob/master/models/densenet.lua) +- [TensorNets] + (https://github.com/taehoonlee/tensornets/blob/master/tensornets/densenets.py) """ from __future__ import absolute_import from __future__ import division @@ -75,7 +78,7 @@ def transition_block(x, reduction, name): x = BatchNormalization(axis=bn_axis, epsilon=1.001e-5, name=name + '_bn')(x) x = Activation('relu', name=name + '_relu')(x) - x = Conv2D(int(x._keras_shape[bn_axis] * reduction), 1, use_bias=False, + x = Conv2D(int(K.int_shape(x)[bn_axis] * reduction), 1, use_bias=False, name=name + '_conv')(x) x = AveragePooling2D(2, strides=2, name=name + '_pool')(x) return x