#102 | mal00 – Introduction to machine learning

Hello everybody, today I’ll start a new category (I know, I know.) which is related to programming, logic and most importantly: learning. I’ve always wanted to do something on machine/deep learning but never got the motivation to really start. I installed multiple library a few times already but I never got the motivation to start. I will, however, be able to also set my other article, the one about changing my way of learning things, in motion.

 

Setting up

First of all, I’ll list what I think I know about deep learning, which could change with time when I’ll work more on the subject:

  • Deep learning is mostly used in image recognition and some form of AI
  • To be able to train a model, you’ll have to setup and transform data to be the most readable by the AI
  • A model will know how he perform by having some kind of data, which will be called “fitness”. For example, in a platform game, a fitness value could be how much farther right the model has been able to go, speed could also enter as a factor
  • There’s some concept about tensor (mostly for library such as Tensorflow from Google)

And what I’d like to do with that in the long term:

  • Be able to analyze a game of Smash Bros, for training or data purposes – Image recognition (Imagine a bot looking at a game, able to tell you when you generally get hit, how an adversary is making errors that could’ve been punished by you, habits of an opponent such as ledge options, …)
  • Training a bot to play a game – AI
  • Creating a security/penetration tester bot – AI
  • Integrating Deep learning with 3D and visualize its progression in a virtual environment – AI/3D

The libraries I will use are mostly going to be Tensorflow, a deep learning library created by Google, or Keras, which is an higher level library put on top of Tensorflow. Keras is being used at large scientific organizations such as CERN or NASA right now, I’ll maybe still need to learn about some concepts Tensorflow. The advantage of Keras is that it is fast to test ideas.

 

Getting started with Keras

Keras works with an idea of a model. First you’ll need to define a model and set a list of operations that needs to be performed on every data using “sequences” and “layers”. You’ll then need to compile your model, where you’ll be able to specify the “loss functions” and the “optimizers”. Then you’ll have to fit your model, which is basically running multiple tests on your dataset. And last you’ll then be able to make predictions, using the model you trained previously.

There are a few basic types of API style available on Keras:

  • The sequential model: Which is the default one and it means that you’ll give him one input and it’ll give you one output, it is good for 70% of the cases.
  • The functional API: Which takes multiple input and give multiple outputs. Good for 95% of the cases.
  • Model subclassing: Which gives the maximum flexibility.

 

Leave a Reply

Your email address will not be published.