Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungFliproom: a room changeover is a content problem(21.09.2026 um 04:10 Uhr)
Sichere ProgrammierungNova Adiutrix: My Second Agent Built My First Project's To-Do List(21.09.2026 um 04:11 Uhr)
Sichere ProgrammierungFliproom: a room changeover is a content problem(21.09.2026 um 04:10 Uhr)
Sichere ProgrammierungNova Adiutrix: My Second Agent Built My First Project's To-Do List(21.09.2026 um 04:11 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Understanding Multiple Inputs in Neural Networks (With Python Examples) — Part 2

Reagiere als Erste:r — dein Feedback zählt!

In the previous article, we plotted a surface using inputs related to Petal Width and Sepal Width to predict whether the species is Setosa or not.

Let’s continue with the remaining steps.

After plotting the bent surface, we need to multiply all the points by -0.1.

import numpy as np
import matplotlib.pyplot as plt

# Create a grid of dots across the entire bottom plane
p_dots = np.linspace(0, 1, 6)
s_dots = np.linspace(0, 1, 6)
P_grid, S_grid = np.meshgrid(p_dots, s_dots)

# Calculate surface values
Y_grid_dots = np.maximum(
    0,
    (P_grid * -2.5) + (S_grid * -0.6) + 1.6
)

# Scale the bent surface
Y_grid_dots = Y_grid_dots * -0.1

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

ax.plot_surface(
    P_grid,
    S_grid,
    Y_grid_dots,
    alpha=0.7
)

ax.set_xlabel('Petal Width')
ax.set_ylabel('Sepal Width')
ax.set_zlabel('Setosa Output')

plt.show()

Now we do the exact same thing for the bottom node in the hidden layer.

We apply ReLU to this and then multiply the result by 1.5 to get the final orange bent surface.

import numpy as np
import matplotlib.pyplot as plt

# Create a grid of dots across the entire bottom plane
p_dots = np.linspace(0, 1, 6)
s_dots = np.linspace(0, 1, 6)
P_grid, S_grid = np.meshgrid(p_dots, s_dots)

# Bottom hidden node calculation
Y_grid_dots = np.maximum(
    0,
    (P_grid * -1.5) + (S_grid * 0.4) + 0.7
)

# Apply output weight
Y_grid_dots = Y_grid_dots * 1.5

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

ax.plot_surface(
    P_grid,
    S_grid,
    Y_grid_dots,
    color='orange',
    alpha=0.7
)

ax.set_xlabel('Petal Width')
ax.set_ylabel('Sepal Width')
ax.set_zlabel('Setosa Output')

plt.show()

Now we add the y-axis coordinates of the blue bent surface to the y-axis coordinates of the orange bent surface.

We do this for every single point, and we end up with this green surface.

import numpy as np
import matplotlib.pyplot as plt

# Create a grid of dots across the entire bottom plane
p_dots = np.linspace(0, 1, 6)
s_dots = np.linspace(0, 1, 6)
P_grid, S_grid = np.meshgrid(p_dots, s_dots)

# ----- Blue surface (top hidden node) -----
Y_blue = np.maximum(
    0,
    (P_grid * -2.5) + (S_grid * -0.6) + 1.6
)
Y_blue = Y_blue * -0.1

# ----- Orange surface (bottom hidden node) -----
Y_orange = np.maximum(
    0,
    (P_grid * -1.5) + (S_grid * 0.4) + 0.7
)
Y_orange = Y_orange * 1.5

# ----- Final output surface (sum) -----
Y_final = Y_blue + Y_orange

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

ax.plot_surface(
    P_grid,
    S_grid,
    Y_final,
    color='green',
    alpha=0.7
)

ax.set_xlabel('Petal Width')
ax.set_ylabel('Sepal Width')
ax.set_zlabel('Setosa Output')

plt.show()

At the end, we need to add the bias, which is 0.
This does not change the green surface, so this is the final output for Setosa.

From this, we can understand that the value for Setosa is highest when the petal width is close to 0.

Similarly, the value for Setosa is lowest when the petal width is close to 1.

In the next article, we will explore how to use this neural network to predict Setosa, Versicolor, and Virginica.

You can try the examples out in the Colab notebook.

Looking for an easier way to install tools, libraries, or entire repositories?
Try Installerpedia: a community-driven, structured installation platform that lets you install almost anything with minimal hassle and clear, reliable guidance.

Just run:

ipm install repo-name

… and you’re done! 🚀

Installerpedia Screenshot

🔗 Explore Installerpedia here

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Understanding Multiple Inputs in Neural Networks (With Python Examples) — Part 2

Thematisch verwandte Begriffe: Understanding, Multiple, Inputs, Neural · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93977 | A vulnerability was determined in code-projects Assessment Management 1.…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick