mirror of
https://github.com/helblazer811/ManimML.git
synced 2025-05-22 13:06:46 +08:00
16 lines
450 B
Python
16 lines
450 B
Python
from manim import *
|
|
import numpy as np
|
|
|
|
from manim_ml.neural_network.activation_functions.activation_function import (
|
|
ActivationFunction,
|
|
)
|
|
|
|
class SigmoidFunction(ActivationFunction):
|
|
"""Sigmoid Activation Function"""
|
|
|
|
def __init__(self, function_name="Sigmoid", x_range=[-5, 5], y_range=[0, 1]):
|
|
super().__init__(function_name, x_range, y_range)
|
|
|
|
def apply_function(self, x_val):
|
|
return 1 / (1 + np.exp(-1 * x_val))
|