kiwigrad
1.0.0

Pytorch 및 Tensorflow 와 같은 하늘을 날아갈 수있는 능력이 부족했지만 Kiwigrad는 여전히 발견되지 않은 잠재력을 가진 강력한 새입니다.
Kiwigrad? 예, 재미와 실험을 위해 만들어진 마이크로 그라드의 또 다른 버전입니다.
현재 릴리스를 설치하려면
pip install kiwigrad==0.28 Kiwigrad는 MicroGrad의 수정 된 버전이며 추가 기능이있는 Minigrad 패키지입니다. Kiwigrad에 추가 된 주요 기능은 다음과 같습니다.
from kiwigrad import MLP , Layer
class PotNet ( MLP ):
def __init__ ( self ):
layers = [
Layer ( nin = 2 , nout = 16 , bias = True , activation = "relu" ),
Layer ( nin = 16 , nout = 16 , bias = True , activation = "relu" ),
Layer ( nin = 16 , nout = 1 , bias = True , activation = "linear" )
]
super (). __init__ ( layers = layers )
model = PotNet () from kiwigrad import Value , draw_dot
a = Value ( - 4.0 )
b = Value ( 2.0 )
c = a + b
d = a * b + b ** 3
c += c + Value ( 1. )
c += Value ( 1. ) + c + ( - a )
d += d * Value ( 2 ) + ( b + a ). relu ()
d += Value ( 3. ) * d + ( b - a ). relu ()
e = c - d
f = e ** 2
g = f / Value ( 2.0 )
g += Value ( 10.0 ) / f
print ( f' { g . data :.4f } ' ) # prints 24.7041, the outcome of this forward pass
g . backward ()
print ( f' { a . grad :.4f } ' ) # prints 138.8338, i.e. the numerical value of dg/da
print ( f' { b . grad :.4f } ' ) # prints 645.5773, i.e. the numerical value of dg/db
draw_dot ( g ) cd test
pytest .