def time_gate_fast_2(phase, r_on, leak_rate, training_phase):
if not training_phase:
leak_rate = 1.0
is_up = tf.less(phase, (r_on * 0.5))
is_down = tf.logical_and(tf.less(phase, r_on), tf.logical_not(is_up))
time_gate = tf.where(is_up, 2 * phase / r_on, tf.where(is_down, 2. - 2. * (phase / r_on), leak_rate * phase))
return time_gate
phased_lstm.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录