# ----------
#
# As with the previous perceptron exercises, you will complete some of the core
# methods of a sigmoid unit class.
#
# There are two functions for you to finish:
# First, in activate(), write the sigmoid activation function.
# Second, in update(), write the gradient descent update rule. Updates should be
# performed online, revising the weights after each data point.
#
# ----------
import numpy as np
class Sigmoid:
"""
This class models an artificial neuron with sigmoid activation function.
"""
def __init__(self, weights = np.array([1])):
Sigmoid python实现
最新推荐文章于 2025-07-11 13:51:16 发布