Gradients

Support functions and objects for differentiating neuromancer objects Computing gradients, jacobians, and PWA forms for components, variables, and constraints

neuromancer.gradients.gradient(y, x, grad_outputs=None, create_graph=True)[source]

Compute gradients dy/dx :param y: [tensors] outputs :param x: [tensors] inputs :param grad_outputs: :return:

neuromancer.gradients.jacobian(y, x)[source]

Compute J = [dy_1/dx_1, …, dy_1/dx_n, dy_m/dx_1, …, dy_m/dx_n] computes gradients dy/dx at grad_outputs in [1, 0, …, 0], [0, 1, 0, …, 0], …., [0, …, 0, 1] :param y: [tensor] outputs :param x: tensor] inputs :return: