hikettei / cl-waffe2

[Experimental] Graph and Tensor Abstraction for Deep Learning all in Common Lisp
https://hikettei.github.io/cl-waffe2/
MIT License
124 stars 5 forks source link

[BugFix] backward definition of define-static-node #32

Closed hikettei closed 1 year ago

hikettei commented 1 year ago
(defun softmax-cross-entropy-test1 ()
  (let ((a (parameter (randn `(10 10))))
    (b (parameter (randn `(10 10)))))

    (proceed-backward (!sum (softmax-cross-entropy (!relu a) (!relu b))))
    (and
     (some #'(lambda (x) (not (= x 0))) (tensor-vec (grad a)))
     (some #'(lambda (x) (not (= x 0))) (tensor-vec (grad b))))))

define-static-node with multiple variables is now working.