lecture 2
introduction to
data types,
functions,
and barcode detection
SeAts APp SEAtS ApP SEaTS APP
GAME TIME!
the 12
hard memorising (no)
vs
understanding (yes)
pattern recognition as an example...
one key is "generalisability"
another key is "explanation in simple words only"
the Feynman Technique (check it out)
this is also what i'm trying to do πŸ₯°
gun for show knife for a pro
disclaimer: complex words are VERY important for communication
noodling time:
these ideas are numerically embedded in AI training technique as well... 🫣
aka "overfitting" and "regularisation"
we'll see
how we learn AI reflects in how AI learn (us)
breaking the fourth wall!🀯
avoid categorical thinking
things are more connected than they look like
this lecture we will go through more high-level abstract ideas as well as little low-level technical stuff
dots will be connected!
more applications starting next week😜
Recap{
(human) intelligence:
- pattern recognition 🌌
- pattern generation πŸ¦„
- task solving, story telling, emotions, etc.
artificial intelligence:
- nice tool to have πŸ”¨ (engineering)
- for better understanding intelligence 🧬 (natural science)
representation:
- inevitable (our natural language falls short)
- powerful (good ones simplify recognition tasks)
representation:
- descriptive, "features"
- contextual, task-dependent
- perspective, always partial
numbers:
- strong representational power (for different data modalities)
- introducing the tool called math as our DAMAIN EXPANSION
- used with "protocol" (for consistent interpretation)
roles of numbers:
- count
- measure
- label
models:
- input, do some process, output
models:
- when using a model for the first time, ask about its input and output
- usually its input and output are numbers, then ask about the "protocol"
face recognition as an example:
- input: image (any size)
- output: bounding boxes and landmark locations (in numbers)
/*end of recap*/
}
Go further with numbers
data types{
numerical/quantitative
categorical/qualitative
numerical/quantitative
- discrete (count)
- continuous (measure)
exceptions may apply
shoe sizes πŸ‘Ÿ
numerical
- Usually discrete values occurs as the result of counting something
- and continuous values occurs as the result of measuring something
but exceptions may apply
- 🌢️ can you think of an exception case where the data comes from measuring but is of discrete type?
categorical/qualitative
- ordinal (categories with an implied order)
- nominal (named category, no order implied)
exceptions may apply
23
hint: πŸ€
point coordinates in an image?
analog
digital
lets appreciate this vinyl under microscope for 10 seconds
vid here
lets zoom in this awesome drum loop in ableton
two examples from last lecture revisited:
007
🍎
πŸ’
don't confuse data types with data categories/modalities
(data category/modality is looking from the perspective of "where do the data come from") more on this in the future
(data type is from "what are the characteristics of the numbers in the data" )
no hard memorising
/*end of data types*/
}
Go further with models
introduction to functions{
why we suddenly talk about function?
let's look at the (simple) definition of function
a function is a relationship between inputs where each input is related to exactly one output
what are the keywords there? do these sound familiar?
but why this weird construct of "input, process, output"? where else can you find this pattern?
β˜•οΈ sit back and watch this geeky vid from 5 years ago
model can be seen as a set of function
what does function do? (in high-level abstraction)
two perspectives of thinking:
mapping: captures relation between input and output (laser beams)
transformation: operation on the input (like folding a paper), transform it into the output and spit out the output ("dynamic" process)
these two are connected actually... avoid categorical thinking...
for fancy AI stuff (starting next week yay), i find the "transformation" perspective more helpful for understanding
some conventions on function expression
input: x
function body: some maths operations on x
function output: f(x)
domain: the set of all possible inputs
f(x) = 2x (draw on whiteboard)
to understand function as a tranformation process...
me "小" as a function:
🍎 -> 小 -> lecture
小(🍎) = lecture
πŸ₯ƒ -> 小 -> πŸ€ͺ
小(πŸ₯ƒ) = lEcTUrE
you "lovelyStudents" as a function:
lecture -> lovelyStudents -> good sleep πŸ’€
lovelyStudents(lecture)= good sleep πŸ’€
we can chain functions together!
lovelyStudents(小(🍎))= good sleep πŸ’€
recall models as a set of functions
good old face location detection model as f:
f(image) = bounding box
(expand into numeric representations on whiteboard)
how about dog or cat classification model?
notice the dimension of the output is different from the input
there has to be some parts inside the function that reduce (or expand) dimensions
we have a nice maths tool to manipulate dimensionality, more on this next week 😜
let's introduce some function types!
jargons alert but don't be afraid they are cute
exponential
sigmoid
quadratic
relu
sine
draw on whiteboard...are we familiar with this graphic representation of functions?
recap
tool making
tool using
of course function is our tool
to use a function:
like a model, we feed in the input, get an output and do whatever
our first time touching upon tool making:
to make a function working, we want to "shape"/"tune" the function so that it captures the right transformation
I'll leave how to shape a function to next lecture (the "learning" process)
for now, let's look at what parts of function can be shaped (the affordance)
let's think graphically...
task: i have these points on whiteboard and i want to have a function go through each of these (weaving)
back to the human and function analogy
our skeleton are sort of fixed and serve as our scaffold,
to achieve different physical tasks,
we train our muscles (skeleton are untrainable ;( )
important things from this analogy are:
- some parts are fixed and untrainable
- other parts are trainable
scaffold of function(the fixed): its type
muscles of function(the shapeable/trainable/learnable): its parameters
parameters: all the parts in a function that are "shapeable" once the type is fixed
wait but why do we fix the type of function if there are better options???
it is not that we want to but we have to... (more on this later)
basically it is constrained by how learning process is currently interpreted and implemented in mathematics (hint: derivatives)
usually during model making, we have to choose the scaffold of function first and it will remain fixed.
we might also want to reshape our skeleton if we can πŸ₯Ά
in summary, to make a function that is good at "weaving":
firstly, we define the funcion type, could be a combination of any type.
ways of combination could be adding, chaining, multiplying, etc.
recall model as a set of functions
secondly, we shape its muscles aka parameters
in deep learning terms, these "shapeable" parameters comprise weights and biases
example of weights and biases in linear function
example of weights and biases in quadratic function
till now we only have used one type of function for weaving,
to increase the "expressiveness" of our selected function type,
we can go "overshoot" by including different functin types as one big function to be shaped,
expressiveness: it has potential to be shaped into different kinds of shapes
weights can be zero
overshoot big function can always be reduced to simple ones
deep learning is also based on the idea of starting with a (BIG) function that has great expressiveness
these notions will become clearer (dots being connected) in the future lecture
take home message:
- scaffold and muscle
- the task of weaving
- function types have different shapes
- overshoot using big function to increase expressiveness
end of noodling today, fun stuff now
different "personalities" of functions
- asymptotic (quite philosophical, it touches the notion of infinity)
- squash anything to be between 0 and 1 (remember probability?πŸ˜‰)
- symmetric (things can go wrong in many directions...)
- ignore negative(booo) numbers
- periodic (wooo, aperiodic signal can be represented by periodic stuff only)
🀯
underneath these functions of different personalities,
they all have the same "DNA" (polynomials)
they can all be represented just using polynomials and here is an example
avoiding categorical thinking
/*end of intro to functions*/
}
construction timeπŸ”§
codes here
a COOL AI project borrowed from Murad's slides
In the artwork Pareidolia* facial detection is applied to grains of sand. A fully automated robot search engine examines the grains of sand in situ. When the machine finds a face in one of the grains, the portrait is recorded.
emoji overlaying app perhaps?
image refs:
https://impuria.com/blogs/impuria-ear-piercing-jewelry/least-to-most-painful-ear-piercings-a-comprehensive-ranking