-
Notifications
You must be signed in to change notification settings - Fork 57
New blog page : 🧠 simple neuron in GO #478
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
base: master
Are you sure you want to change the base?
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
images/posts/2025-10-10-AI-neural-in-go-on-collab/GO_simple_neuron.ipynb
Outdated
Show resolved
Hide resolved
images/posts/2025-10-10-AI-neural-in-go-on-collab/GO_simple_neuron.ipynb
Outdated
Show resolved
Hide resolved
images/posts/2025-10-10-AI-neural-in-go-on-collab/GO_simple_neuron.ipynb
Show resolved
Hide resolved
images/posts/2025-10-10-AI-neural-in-go-on-collab/GO_simple_neuron.ipynb
Outdated
Show resolved
Hide resolved
d7449c0 to
6e29e4f
Compare
pmartin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A general comment: in markdown, line breaks do not translate to line breaks in the output.
You need either an empty line to create a new paragraph, or two spaces at the end of a line to create a line break.
|
|
||
| It uses "deep learning concept" in "machine learning". | ||
| To do so I will guide you with an example in GO running in a Google Colab environment. | ||
| Why go? Because when we talk about AI, most of the time you have code in python but we hardly use GO at Bedrock. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"we hardly use GO" → are you sure this means what you want? I understand this as "nous utilisons à peine Go", which I don't think is what you meant?
| Deep learning is a part of the AI family. | ||
|  | ||
|
|
||
| I will not give a detailed definition about IA or machine learning, because it's not the purpose of this article. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| I will not give a detailed definition about IA or machine learning, because it's not the purpose of this article. | |
| I will not give a detailed definition about AI or machine learning, because it's not the purpose of this article. |
| I will not give a detailed definition about IA or machine learning, because it's not the purpose of this article. | ||
| I will just give some definitions about AI and machine learning to help understanding what lies behind these terms. | ||
|
|
||
| **AI** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list of definitions needs reformating: it is currently displayed as a single paragraph.
|
|
||
| As you can see, what we recently call "AI" (LLM and image generation) are a small part of AI. Their common point is learning by minimizing an error which looks like the way humans learn but in fact it's slightly different. | ||
| Modern AI are using different "systems" to encode input and learn how to find the right solution. | ||
| This post will focus on the base of the system : how it computes an output from an input? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This post will focus on the base of the system : how it computes an output from an input? | |
| This post will focus on the base of the system : how does it compute an output from an input? |
| Of course there is several easy ways to resolve it and maybe you will use mathematics to find these solutions. | ||
| But don't forget our neuron is "naïve", it does not know anything about maths or equations. It will just learn with the fail/retry method. | ||
|
|
||
| ### How a neuron "learn" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### How a neuron "learn" | |
| ### How a neuron "learns" |
| Then you have the neuron.go file which describe the neuron model. | ||
|
|
||
| ``` | ||
| %%writefile neurone.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code uses neurone.go but the text before it says neuron.go
|  | ||
|
|
||
| ### Results | ||
| for each runned part, you will get an output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for each runned part, you will get an output. | |
| For each part run, you will get an output. |
| ### Results | ||
| for each runned part, you will get an output. | ||
|
|
||
| for neurone.go file you'll have a message to confirm the file creation (or overwrite if you already loaded it) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for neurone.go file you'll have a message to confirm the file creation (or overwrite if you already loaded it) | |
| For `neurone.go` file you'll have a message to confirm the file creation (or overwrite if you already loaded it) |
|
|
||
| If you try it: 1*0.06826215000443395 + 2*1.4283067951201867 + 2.07460060154341 and you get 4,999476341788217 🎉 | ||
|
|
||
| You can also see the "loss" decreasing during the learning phase : The more the neuron learn the less the value of the loss is and the more the accuracy is ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| You can also see the "loss" decreasing during the learning phase : The more the neuron learn the less the value of the loss is and the more the accuracy is ! | |
| You can also see the "loss" decreasing during the learning phase: the more the neuron learns, the less the value of the loss is and the more the accuracy is ! |
| ## 👨🏻🏫 Conclusions | ||
| As you can see, a neuron can learn without any knowledge, just by giving it data and applying mathematical concepts to make it "learn". | ||
| If you launch multiple times the learning process, you may find a different result (because initial values may vary). | ||
| In fact, this example is useless in the real world because we can resolve the problem by ourselves. This is why "neural networks", used in most AI like text generation, image detection or generation, are using thousand of neuron! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thousands?
New article about building a simple neuron in GO.
The goal is to describe basics concepts of a single neuron which is the base of neural networks.