Skip to content

Commit f98ea45

Browse files
committed
added weight decay alias l2 loss to all networks
1 parent 0a872ad commit f98ea45

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

model/model.py

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def cal_loss(logits, labels):
3737
cross_entropy_per_example, name='cross_entropy')
3838
tf.add_to_collection('losses', cross_entropy)
3939

40+
# The total loss is deined as the cross entropy loss plus all of the weight
41+
# decay terms (L2 loss).
4042
return tf.add_n(tf.get_collection('losses'), name='total_loss')
4143

4244

networks/patchy_san_slic_pascal_voc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@
8585
"fully_connected": [
8686
{
8787
"output_channels": 2048,
88-
"weights": { "stddev": 1e-1, "decay": 0.0 },
88+
"weights": { "stddev": 1e-1, "decay": 0.004 },
8989
"biases": {"constant": 1.0 }
9090
},
9191
{
9292
"output_channels": 1024,
93-
"weights": { "stddev": 1e-1, "decay": 0.0 },
93+
"weights": { "stddev": 1e-1, "decay": 0.004 },
9494
"biases": {"constant": 1.0 }
9595
}
9696
],

networks/vgg16_pascal_voc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@
104104
"fully_connected": [
105105
{
106106
"output_channels": 4096,
107-
"weights": { "stddev": 1e-1, "decay": 0.0 },
107+
"weights": { "stddev": 1e-1, "decay": 0.004 },
108108
"biases": {"constant": 1.0 }
109109
},
110110
{
111111
"output_channels": 4096,
112-
"weights": { "stddev": 1e-1, "decay": 0.0 },
112+
"weights": { "stddev": 1e-1, "decay": 0.004 },
113113
"biases": {"constant": 1.0 }
114114
}
115115
],

networks/vgg19_pascal_voc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@
122122
"fully_connected": [
123123
{
124124
"output_channels": 4096,
125-
"weights": { "stddev": 1e-1, "decay": 0.0 },
125+
"weights": { "stddev": 1e-1, "decay": 0.004 },
126126
"biases": {"constant": 1.0 }
127127
},
128128
{
129129
"output_channels": 4096,
130-
"weights": { "stddev": 1e-1, "decay": 0.0 },
130+
"weights": { "stddev": 1e-1, "decay": 0.004 },
131131
"biases": {"constant": 1.0 }
132132
}
133133
],

0 commit comments

Comments
 (0)