Jump to content
  • entries
    6
  • comments
    0
  • views
    385

YSA - Bir Nöron Katmanı


Doğuhan ELMA

62 views

Sinir ağları tipik olarak birden fazla nörondan oluşan katmanlara sahiptir. Katmanlar nöron gruplarından başka bir şey değildir. Bir katmandaki her nöron tam olarak aynı girdiyi alır; katmana verilen girdi (bu, eğitim verileri veya önceki katmanın çıktısı olabilir), ancak kendi ağırlık setini ve kendi önyargısını içerir ve kendi benzersiz yanıtını üretir. çıktı. Katmanın çıktısı, her nöron başına bir tane olmak üzere bu çıktıların her birinin bir kümesidir. Diyelim ki bir katmanda 3 nöron ve 4 girdiden oluşan bir senaryomuz var:

1.png

inputs = [1, 2, 3, 2.5]
weights1 = [0.2, 0.8, -0.5, 1]
weights2 = [0.5, -0.91, 0.26, -0.5]
weights3 = [-0.26, -0.27, 0.17, 0.87]
bias1 = 2
bias2 = 3
bias3 = 0.5
outputs = [
# Neuron 1:
inputs[0]*weights1[0] +
inputs[1]*weights1[1] +
inputs[2]*weights1[2] +
inputs[3]*weights1[3] + bias1,
# Neuron 2:
inputs[0]*weights2[0] +
inputs[1]*weights2[1] +
inputs[2]*weights2[2] +
inputs[3]*weights2[3] + bias2,
# Neuron 3:
inputs[0]*weights3[0] +
inputs[1]*weights3[1] +
inputs[2]*weights3[2] +
inputs[3]*weights3[3] + bias3]
print(outputs)
>>>
[4.8, 1.21, 2.385]

Numpy ile;

import numpy as np

inputs = [1, 2, 3, 2.5]
weights1 = [0.2, 0.8, -0.5, 1]
weights2 = [0.5, -0.91, 0.26, -0.5]
weights3 = [-0.26, -0.27, 0.17, 0.87]
bias1 = 2
bias2 = 3
bias3 = 0.5

outputs = [np.dot(inputs,weights1) + bias1,
           np.dot(inputs,weights2) + bias2,
           np.dot(inputs,weights3) + bias3]
print(outputs)
[4.8, 1.21, 2.385]

1.png

import numpy as np

inputs = [1.0, 2.0, 3.0, 2.5]

weights = [[0.2, 0.8, -0.5, 1],
[0.5, -0.91, 0.26, -0.5],
[-0.26, -0.27, 0.17, 0.87]]

biases = [2.0, 3.0, 0.5]

outputs = np.dot(weights, inputs) + biases
print(outputs)
[4.8, 1.21, 2.385]

 

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...