The Doctor
Senior Member
- Dec 18, 2010
- 1,109
- 474
I've been a programmer most all my life. I wish I would have gotten into machine learning algorithms at an early age but for some reason I didn't. I went to college for computer science but I dropped out because most of the things I was to be taught, I already knew. This is not one of those things.
AI is everywhere and certainly in marketing but the average marketer doesn't have access to these algorithms. Not like a programmer does anyway. Machine learning is hard. It takes a lot of maths and dedicated learning. I have recently started down this path (Beyond simply knowing the abstract ideas) so I figured it would be a good idea to chronicle it so that others may benefit and so that in explaining things here, it will better solidify in my brain.
To those ends I have just built a new computer that should be able to handle the algorithms. Here are the parts I've assembled in the machine:
The first long-term goal is to get to a point where I can run predictive analysis of things like ad placements. I think a recurrent neural network would be best for that since they deal with timeseries data. Not 100% sure though. My first step has been to follow a Tensorflow tutorial. I have done that. I don't completely understand what's going on yet but I know a lot more than I did before. Let's go over some of the basics.
This is a crude drawing of two neurons. Information flows into the dendrites. Some sort of calculation/function is performed in the nucleus which decides if the neuron is going to fire or not. If it does fire, a signal is sent down the axon and through the synapse to the next neuron.
So here's how we tend to approximate that in computers:
On the left we have our input data (x1, x2 ,x3). There can be a lot more than 3. In the first tutorial I did, there were 784 input values. Those input values are all summed together but first, they're weighted (w1, w2, w3). You have the original input value multiplied by the weight and then they're all added together (Summed). The neuron, based on the input, will either fire or not. In ANNs, a neuron always produces a value whether it fires or not (1 for fire, 0 for not fire). To determine whether or not it fires, the data gets passed through an activation function:
This shape above is the shape of an activation function called a step function (You can see why). It means that it's at 0 (Not fire) and if you pass a threshold of x, the return value for y is 1 (Fire). After that, the output of the neuron is fed into the input of another connected neuron:
That will continue to happen for as many hidden layers as you have in your ANN. The step function was a good example for illustrating neurons but typically we don't use step functions. This is because step functions produce a 0 or a 1. In ANNs, we want more fine-tuned decisions than that such as a decimal number that can be anything from 0 to 1. To that end, we can use a sigmoid function which looks like this:
Now let's go back to the previous illustration...
Your output (y) is simply a function of your x's * your w's (Input data times the weights). It's also a function of your activation function. This will be clarified at a later date.
We now illustrate a deep neural network. A deep net is simply a neural network which has two or more hidden layers. In my next post I will get into the first code I wrote. I'm using Python 3.6.2 on Linux. If you want to follow along and do this, you'll need to install:
You should already have a decent understanding of Python before attempting any of this. If you don't, the official Python tutorial will serve you well. Next time I'm going to attempt to break down training a classifier for the MNIST dataset (Recognizing handwritten digits). All of my posts in this thread will be in blue so you can easily find them. Stay tuned!
AI is everywhere and certainly in marketing but the average marketer doesn't have access to these algorithms. Not like a programmer does anyway. Machine learning is hard. It takes a lot of maths and dedicated learning. I have recently started down this path (Beyond simply knowing the abstract ideas) so I figured it would be a good idea to chronicle it so that others may benefit and so that in explaining things here, it will better solidify in my brain.
To those ends I have just built a new computer that should be able to handle the algorithms. Here are the parts I've assembled in the machine:
- Asus X99-E-10G WS Motherboard
- 32GB Kingston RAM at 3200MHz
- Intel i7-6850K CPU
- 512GB Samsung M.2 NVMe NAND SSD
- 2.5TB of 5 HDD pooled via mergerfs
- NVIDIA Titan X Pascal GPU
- Cosmos 2 Case
- 850W EVGA Power Supply
- Corsair h100i v2 Liquid CPU Cooler
The first long-term goal is to get to a point where I can run predictive analysis of things like ad placements. I think a recurrent neural network would be best for that since they deal with timeseries data. Not 100% sure though. My first step has been to follow a Tensorflow tutorial. I have done that. I don't completely understand what's going on yet but I know a lot more than I did before. Let's go over some of the basics.
What is an artificial neural network?
ANNs are modeled after the biological neural networks in the brain:
So here's how we tend to approximate that in computers:
Now let's go back to the previous illustration...
Your output (y) is simply a function of your x's * your w's (Input data times the weights). It's also a function of your activation function. This will be clarified at a later date.
- Pyenv
- Python 3 (Via Pyenv)
- Tensorflow (With GPU support if you have a GPU)
- A code editor (Such as VS Code)
You should already have a decent understanding of Python before attempting any of this. If you don't, the official Python tutorial will serve you well. Next time I'm going to attempt to break down training a classifier for the MNIST dataset (Recognizing handwritten digits). All of my posts in this thread will be in blue so you can easily find them. Stay tuned!
Last edited: