Skip to content

Commit 306fd4a

Browse files
authored
Merge pull request #118 from lvapeab/master
Written some docs/fixed some code flaws
2 parents 29e4ea0 + c3db88d commit 306fd4a

File tree

3 files changed

+145
-48
lines changed

3 files changed

+145
-48
lines changed

keras_wrapper/cnn_model.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3350,7 +3350,7 @@ def conv_layer(self, x, nb_filter, nb_row, nb_col, dim_ordering,
33503350
dim_ordering=dim_ordering)(x)
33513351

33523352
if padding:
3353-
for i in range(padding):
3353+
for _ in range(padding):
33543354
x = ZeroPadding2D(padding=(1, 1), dim_ordering=dim_ordering)(x)
33553355

33563356
return x
@@ -3367,8 +3367,6 @@ def GoogLeNet_FunctionalAPI(self, nOutput, input):
33673367
CONCAT_AXIS = 1
33683368
NB_CLASS = nOutput # number of classes (default 1000)
33693369
DROPOUT = 0.4
3370-
WEIGHT_DECAY = 0.0005 # L2 regularization factor
3371-
USE_BN = True # whether to use batch normalization
33723370
# Theano - 'th' (channels, width, height)
33733371
# Tensorflow - 'tf' (width, height, channels)
33743372
DIM_ORDERING = 'th'

keras_wrapper/extra/regularize.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ def Regularize(layer, params,
1919
:param params: Params specifying the regularizations to apply
2020
:param shared_layers: Boolean indicating if we want to get the used layers for applying to a shared-layers model.
2121
:param name: Name prepended to regularizer layer
22+
:param apply_noise: If False, noise won't be applied, independently of params
23+
:param apply_dropout: If False, dropout won't be applied, independently of params
24+
:param apply_prelu: If False, prelu won't be applied, independently of params
25+
:param apply_batch_normalization: If False, batch normalization won't be applied, independently of params
26+
:param apply_l2: If False, l2 normalization won't be applied, independently of params
2227
:return: Regularized layer
2328
"""
2429
shared_layers_list = []

0 commit comments

Comments
 (0)