def forward(self, forward_final_output_value, target_value, is_train=True, is_numba=False): self.forward_final_output_value = forward_final_output_value self.target_value = target_value return tff.squared_error(forward_final_output_value, target_value, is_numba=is_numba)
def forward(self, forward_final_output_value, target_value): self.forward_final_output_value = forward_final_output_value self.target_value = target_value return tff.squared_error(forward_final_output_value, target_value)
def forward(self, forward_final_output_value, target_value): self.inputs = [forward_final_output_value, target_value] return tff.squared_error(forward_final_output_value, target_value)
session = tfs.Session() output = session.run(z, feed_dict={x: [1, 2]}) print(output) # 20170912 # initialize a new graph g.initialize() # Create variables w = tfg.Variable(5.0, name="w") b = tfg.Variable(-1.0, name="b") # Create placeholder x = tfg.Placeholder(name="x") # Create hidden node y y = tfg.Affine(w, x, b, name="y") session = tfs.Session() output = session.run(y, feed_dict={x: 1.0}) squared_error = tff.squared_error(output, 14.0) print("Output: {:4.1f}, Squared_Error: {:5.1f}".format(output, squared_error)) output = session.run(y, feed_dict={x: 2.0}) squared_error = tff.squared_error(output, 24.0) print("Output: {:4.1f}, Squared_Error: {:5.1f}".format(output, squared_error)) output = session.run(y, feed_dict={x: 3.0}) squared_error = tff.squared_error(output, 34.0) print("Output: {:4.1f}, Squared_Error: {:5.1f}".format(output, squared_error))