セクション 2. 章 2
single
Challenge: Creating a Neuron
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
Your task is to implement the basic structure of a single neuron by completing the missing parts of the code below.
Follow these steps carefully:
- Initialize parameters:
- Create the array of weights using
np.random.uniform()with values in the range [−1,1). - Create a single bias value using the same uniform distribution.
- Both should be initialized in the neuron's constructor (
__init__).
- Create the array of weights using
- Compute the neuron's input:
- Inside the
activate()method, calculate the weighted sum of the inputs using the dot product:np.dot(inputs, self.weights) - Add the bias to this sum and store the result in the variable
input_sum_with_bias.
- Inside the
- Apply the activation function:
- Use the provided
sigmoid()function to compute the neuron’s output frominput_sum_with_bias. - Store the result in the variable
outputand return it.
- Use the provided
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 2. 章 2
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください