Neural networks can be used in a large variety
of problem areas, including machine translation.
Today, let's take a look at one important
concept that will help lay the foundations
for understanding neural networks: mathematical
functions.
Each neural network represents a particular
function.
For each input, the network calculates an
output value.
Let's take a look at one particular function.
This function accepts as input a letter of
the English alphabet.
The job of this function is to categorize
each letter as either a vowel or as a consonant.
In this example, our function is denoted by
f.
Inside the parentheses, the input to function
f is denoted as x.
After function f calculates an output value
for a particular input x, we denote that output
as y.
Eventually, we might want to build a neural
network that implements this function.
Given such a neural network, we could provide
the network with an input that represents
one of the letters in the English alphabet.
Given this input, the neural network would
calculate an output value.
For each possible input, a function must calculate
an output.
Our function is designed to map from English
letters to either consonant or vowel.
The set of possible input values is called
the domain.
Here, the domain is the set of lowercase English
letters.
The set of possible output values is called
the range.
Here, the range is the set {consonant, vowel}.
Given the English letter "a", our function
should return the value "vowel"
Given the English letter "b", our function
should return the value "consonant"
Our function should return the value "vowel"
when the input to the function is "a",
"e",
"i",
"o"
or "u"
On the other hand, our function should return
the value "consonant" when the input to the
function is "b", "c",
"d",
"f",
"g",
"h",
"j",
"k",
"l",
"m",
"n",
"p",
"q",
"r",
"s",
"t",
"v",
"w",
"x",
"y",
or "z"
One way to implement a function is by using
a general-purpose programming language.
Here is example code using the Swift programming
language that implements the function from
the previous page.
This code defines an enumeration called EnglishLetter
that defines the domain of the function, an
enumeration called SpeechSound that defines
the range of the function, and a function
called f that maps each item from the domain
to exactly one value from the range.
This code checks to see if x is the English
letter "a" or the English letter "e" or the
English letter "i" or the English letter "o"
or the English letter "u".
If x is any of these values, the function
returns the value "vowel".
Otherwise, the function returns the value
"consonant".
In order to represent this same function using
a neural network, we will need to use a much
different technique.
Instead of writing code like this using a
general purpose programming language, we will
design a special kind of connected graph with
weighted edges.
We will discuss the details of that process
in another video.
This presentation was created and narrated
by Lane Schwartz.
You are free to reproduce and adapt this work
under the terms of the Creative Commons Attribution-ShareAlike
4.0 International License.
