File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -396,9 +396,12 @@ def __init__(
396396 name = "full_data_trainers_b_only"
397397 )
398398 with tf .name_scope ("full_gradient" ):
399- # full_gradient = full_data_trainers.gradient[0][0]
400- # full_gradient = tf.reduce_sum(tf.abs(full_gradient), axis=0)
401- full_gradient = tf .reduce_sum (full_data_model .neg_jac , axis = 0 )
399+ # use same gradient as the optimizers
400+ full_gradient = full_data_trainers .gradient [0 ][0 ]
401+ full_gradient = tf .reduce_sum (tf .abs (full_gradient ), axis = 0 )
402+
403+ # # the analytic Jacobian
404+ # full_gradient = tf.reduce_sum(full_data_model.neg_jac, axis=0)
402405 # full_gradient = tf.add_n(
403406 # [tf.reduce_sum(tf.abs(grad), axis=0) for (grad, var) in full_data_trainers.gradient])
404407
You can’t perform that action at this time.
0 commit comments