Skip to content

Commit

Permalink
fix: updated tensorflow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Avsecz committed Feb 10, 2017
1 parent 9742d34 commit 542b68a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,14 @@ History
* feat: added early_stop_patience argument


0.4.4 (2017-02-10)
------------------

* fix: When X_feat had 0 columns, loading its weights from file was failing.
* feat: When training the global model in ConciseCV, use the average number of epochs yielding the best validation-set accuracy.

0.4.5 SNAPSHOT
------------------

* fix: Update tensorflow function (tf.op_scope -> tf.name_scope, initialize_all_variables -> tf.global_variables_initializer)

2 changes: 1 addition & 1 deletion concise/concise.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def model(data, tf_X_feat, var):
#
# http://www.subsubroutine.com/sub-subroutine/2016/11/12/painting-like-van-gogh-with-convolutional-neural-networks

init = tf.initialize_all_variables()
init = tf.global_variables_initializer() #tf.initialize_all_variables()

other_var = {
"tf_X_feat": tf_X_feat,
Expand Down
4 changes: 2 additions & 2 deletions concise/tf_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def l1_loss(tensor, weight=1.0, scope=None):
Returns:
the L1 loss op.
"""
with tf.op_scope([tensor], scope, 'L1Loss'):
with tf.name_scope(scope, 'L1Loss', [tensor]):
weight = tf.convert_to_tensor(weight,
dtype=tensor.dtype.base_dtype,
name='loss_weight')
Expand All @@ -37,7 +37,7 @@ def huber_loss(tensor, k=1, scope=None):
the L1 loss op.
"""
# assert k >= 0
with tf.op_scope([tensor], scope, 'L1Loss'):
with tf.name_scope(scope, 'L1Loss', [tensor]):
loss = tf.reduce_mean(tf.select(tf.abs(tensor) < k,
0.5 * tf.square(tensor),
k * tf.abs(tensor) - 0.5 * k ^ 2)
Expand Down

0 comments on commit 542b68a

Please sign in to comment.