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

p001_basic_neuron_3_inputs for Carbon #180

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
25 changes: 25 additions & 0 deletions Carbon/p001_basic_neuron_3_inputs.carbon
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// CHECK: result: 34
//This is a basic neuron with 3 int inputs
//Associated tutorial by Sentdex:https://www.youtube.com/watch?v=Wo5dMEP_BbI


package ExplorerTest api;


fn Main()-> i32 {

var inputs: [i32; 3] = (1, 2, 3);
var weights: [i32; 3] = (3, 2, 8);
var bias: i32 = 3;

var output: i32 = inputs[0] * weights[0] +
inputs[1] * weights[1] +
inputs[2] * weights[2] +
bias;
Print("The output is:{0}", output);
return 0;

}