Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create P.1 Intro And Neuron Code.cs #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Unity & C#/P.1 Intro And Neuron Code.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using UnityEngine;

public class Script1 : MonoBehaviour
{
// Place this script on an empty Game Object and run.

// Declare Variables
public float[] inputs;
public float[] weights;
public float bias;
public float output;
// Start is called before the first frame update
void Start()
{
//Set values of inputs, weights, and biases
inputs = new float[] { 1.2f, 5.1f, 2.1f };
weights = new float[] { 3.1f, 2.1f, 8.7f };
bias = 3;
}

// Update is called once per frame
void Update()
{
// Update output every frame. Output will be displayed in the inspector for that Game Object.
output = inputs[0]*weights[0] + inputs[1]*weights[1] + inputs[2]*weights[2] + bias;
}
}