# Path: brainforge/atomic/activation_op.py
# class Sigmoid(ActivationFunction):
# 
#     type = "sigmoid"
# 
#     def forward(self, Z: np.ndarray):
#         return s1 / (s1 + np.exp(-Z))
#     
#     def backward(self, A: np.ndarray) -> np.ndarray:
#         return A * (s1 - A)
# 
# class Tanh(ActivationFunction):
# 
#     type = "tanh"
# 
#     def forward(self, Z) -> np.ndarray:
#         return np.tanh(Z)
#     
#     def backward(self, A: np.ndarray) -> np.ndarray:
#         return s1 - A**2
# 
# class ReLU(ActivationFunction):
# 
#     type = "relu"
# 
#     def forward(self, Z) -> np.ndarray:
#         return np.maximum(s0, Z)
#     
#     def backward(self, A) -> np.ndarray:
#         return (A > 0.).astype(A.dtype)
# 
# Path: brainforge/llatomic/llactivation_op.py
# class Sigmoid(LLActivation):
#     type = "sigmoid"
# 
# class Tanh(LLActivation):
#     type = "tanh"
# 
# class ReLU(LLActivation):
#     type = "relu"


import unittest
import numpy as np
from brainforge.atomic.activation_op import (
    Sigmoid as NpSigm, Tanh as NpTanh, ReLU as NpReLU
)
from brainforge.llatomic.llactivation_op import (
    Sigmoid as NbSigm, Tanh as NbTanh, ReLU as NbReLU
)




np.random.seed(1337)

ops = {
    "sigmoid": (NpSigm(), NbSigm()),
    "tanh": (NpTanh(), NbTanh()),

# Path: brainforge/atomic/activation_op.py
# class Sigmoid(ActivationFunction):
# 
#     type = "sigmoid"
# 
#     def forward(self, Z: np.ndarray):
#         return s1 / (s1 + np.exp(-Z))
#     
#     def backward(self, A: np.ndarray) -> np.ndarray:
#         return A * (s1 - A)
# 
# class Tanh(ActivationFunction):
# 
#     type = "tanh"
# 
#     def forward(self, Z) -> np.ndarray:
#         return np.tanh(Z)
#     
#     def backward(self, A: np.ndarray) -> np.ndarray:
#         return s1 - A**2
# 
# class ReLU(ActivationFunction):
# 
#     type = "relu"
# 
#     def forward(self, Z) -> np.ndarray:
#         return np.maximum(s0, Z)
#     
#     def backward(self, A) -> np.ndarray:
#         return (A > 0.).astype(A.dtype)
# 
# Path: brainforge/llatomic/llactivation_op.py
# class Sigmoid(LLActivation):
#     type = "sigmoid"
# 
# class Tanh(LLActivation):
#     type = "tanh"
# 
# class ReLU(LLActivation):
#     type = "relu"


# Path: tests/test_numba_activations.py
import unittest
import numpy as np
from brainforge.atomic.activation_op import (
    Sigmoid as NpSigm, Tanh as NpTanh, ReLU as NpReLU
)
from brainforge.llatomic.llactivation_op import (
    Sigmoid as NbSigm, Tanh as NbTanh, ReLU as NbReLU
)





np.random.seed(1337)

ops = {
    "sigmoid": (NpSigm(), NbSigm()),
    "tanh": (NpTanh(), NbTanh()),

    "relu": (NpReLU(), NbReLU())