"""
// throw away a buffer region on the side
outputs = outputs[self.batch_buffer:-self.batch_buffer]
// make final predictions
preds_length = []
for li in range(self.batch_length - 2*self.batch_buffer):
After Change
sq_diff = tf.squared_difference(self.preds, self.targets[:,self.batch_buffer:self.batch_length-self.batch_buffer,:])
// set any NaN"s to zero
nan_indexes = tf.is_nan(sq_diff)
tens0 = tf.zeros_like(sq_diff)
sq_diff = tf.select(nan_indexes, tens0, sq_diff)
// take the mean
self.loss_op = tf.reduce_mean(sq_diff)
// define optimization
if self.optimization == "adam":
opt = tf.train.AdamOptimizer(self.learning_rate, self.adam_beta1, self.adam_beta2)