Skip to content

For addition adding incrementing grading makes sense, I can't make sense out of the incrementing it for multiplication too, potential bug? #72

Open
@srik-git

Description

@srik-git

def mul(self, other):
other = other if isinstance(other, Value) else Value(other)
out = Value(self.data * other.data, (self, other), '*')

    def _backward():
        self.grad += other.data * out.grad
        other.grad += self.data * out.grad
    out._backward = _backward

    return out

If you have an expression of type (xy)(x*z) then the gradient w.r.t x is not additive, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions