0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ニューラルネットワークをまとらぼ関数シミュリンクで再現

Posted at
function [sigmoid_output, weighted_sum, binary_output] = sigmoid_with_sum(x1, x2, x3)
    % 重みとバイアスを事前に設定(ここでは例として設定)
    w1 = 0.5;  % x1に対する重み
    w2 = -0.3; % x2に対する重み
    w3 = 0.8;  % x3に対する重み
    bias = 0.4; % バイアス項

    % 重み付き入力の合計
    weighted_sum = w1 * x1 + w2 * x2 + w3 * x3 + bias;
    
    % シグモイド関数
    sigmoid_output = 1 / (1 + exp(-weighted_sum));  % シグモイド関数の適用

    % ビット生成出力: sigmoid_output が 0.5 より小さいなら 0、そうでなければ 1 を出力
    if sigmoid_output < 0.5
        binary_output = 0;
    else
        binary_output = 1;
    end
end

image.png

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?