https://medium.com/@VictorBanev/the-simplest-learning-machin...
This is a description of a 5-line algorithm that learns and stores approximate probability of an event using just 1 byte of persistent memory.
That was the first thing that came to mind when I read "the smallest brain you can build". Nowadays, that "small brain" would likely be built on a breadboard using op-amps instead.
If you don't know ML I don't think you're going to learn much through ad hoc demos.
Going further backwards, the transistor (or a PNP junction) is the hardware level enabler of the IF statement. The action (switching) driven by the current which in turn controls other switches, is the first manifestation of "observe and act" by inanimate things at the speed of electricity.
Mechanical equivalents existed ofcourse - speed of a governer which controls the flow of fuel which in turn controls the speed of the governer.
let gravity = setInterval( _ => { if (projectile.object3D.position.y > 0) projectile.object3D.position.y \*= .99 }, 100)
Jokes aside I find that providing ridiculously short toy examples that provide the very limited foundation of a concept are extremely empowering in pedagogy. You "get" it right away because it "fits" in your mind, then you dare tinker with it and quickly see how limited it is, then get excited again. It's a powerful trick to learn more IMHO.I played with similar approach in JavaScript and built a NanoNeuron https://github.com/trekhleb/nano-neuron (it is more verbose than Python though)
import random
learning_rate = 0.1
EPOCHS = 50
NUM_INPUTS = 3
weights = [random.uniform(-1, 1) for _ in range(NUM_INPUTS)]
bias = random.uniform(-1, 1)
data = []
for _ in range(100):
inputs = [random.uniform(-1, 1) for _ in range(NUM_INPUTS)]
result = sum(inputs) > 0
data.append((inputs, result))
for epoch in range(EPOCHS):
for inputs, result in data:
weighted_sum = bias
for i in range(NUM_INPUTS):
weighted_sum += inputs[i] * weights[i]
prediction = weighted_sum > 0
if prediction != result:
error = int(result) - int(prediction)
for i in range(NUM_INPUTS):
weights[i] += learning_rate * error * inputs[i]
bias += learning_rate * error
print(f"Final weights: {[round(w, 3) for w in weights]}")
print(f"Final bias: {round(bias, 3)}")> In 1958, a researcher named Frank Rosenblatt built a machine *he called* the perceptron.
> It was *inspired* by a single brain cell, a neuron.
Or to put it another way are there any local only tools that can be trained on my own set of images to automatically tag new images? Tools that do not already have built in classes of image.
I take a lot of photographs and it would be handy to reduce the drudgery of tagging them so to say broadly what the subject was so that they are easier to find later.
f(x) = 0.