Ricardo's Place Robotics, machine learning, or simply random thoughts!

Easy-peasy Deep Learning and Convolutional Networks with Keras - Part 2

This is the continuation (finally!), or the Part 2, of the “Easy-peasy Deep Learning and Convolutional Networks with Keras”. This post should be something self-contained, but you may enjoy reading Part 1 and Part 1½… it’s up to you.

Around one week ago, I’d attended a CUDA workshop presented (or should I say conducted?) by my friend Anthony Morse and I’m still astounded by DIGITS. So, during the workshop, I had some interesting ideas to use on this post!

The first thing I thought when I read (or heard?) for the first time the name Convolutional Neural Network was a bunch of filters (Gimp would agree with me). I’m an Electrical Engineer and, for most of us (Electrical Engineers), convolutions start as nightmares and, gradually, become our almighty super weapon after a module like Signal and Systems.

Let’s start with something easy… a video! Below, you can observe, step-by-step, what happens when a 2D convolution (think about a filter that detects, or enhances, edges) is applied to an image:


Read more...

How to keep things running after you close your terminal (Linux/Unix)

When you start playing with cloud computing like Amazon Web Services, you will, sometimes, decide to launch a program that will take a while to run. If you simply close the connection before all processes are finished, the system will terminate bash (or whatever shell you were using) and, therefore, your program will be also terminated. Normally, when we are working on a terminal, we make use of the & (or ctrl+z and bg) to send things to the background freeing the terminal. If you sent your process to background, you will be able to use jobs to display information about processes that are sleeping (the ctrl+z thing) or running on the background.

Read more...

Mounting an external USB device formatted with exFAT on Linux Ubuntu

This post is a personal reminder. I’m always forgetting Ubuntu (up to 16.04), doesn’t know how to mount exFAT - Extended File Allocation Table and then I need to Google for it. Why would you need exFAT? Among other things, it’s possible to have files bigger than 4GB.

Read more...

Easy-peasy Deep Learning and Convolutional Networks with Keras - Part 1½

This is the continuation, Part 1½, of the “Easy-peasy Deep Learning and Convolutional Networks with Keras”. Do you really need to read Part 1 to understand what is going on here? Honestly, probably not, but I would suggest you doing so anyway.

Layers output as images
This is what my trained network outputs, but viewed as RGB images.

Read more...

Running a Jupyter Notebook (IPython) on a remote server

Do you know what is a Jupyter Notebook? If you don’t, please, have a look at the previous link and come back later… just joking… ok, seriously, check the previous link because they will do a much better job explaining what is a Jupyter Notebook than me :wink:.

jupyter notebook
This is what I was doing just before start writing this post.

Read more...

Easy-peasy Deep Learning and Convolutional Networks with Keras - Part 1

Deep learning… wow… this is “the” hot topic since, at least, some good years ago! I’ve attended a few seminars and workshops about deep learning, nevertheless I’ve never tried to code something myself - until now! - because I had always another priority. Also, I have to admit, I thought it was a lot harder and it would need much more time to be able to run anything that was not simply a sample code.

Classification of Dogs and Cats
Example of classification results.

I’m always forgetting things, so I like to take notes as if I was teaching a toddler. Consequently, this post was designed to remember myself when I forget how to use Keras :expressionless:.

All the things I’ll explain below will only make sense if you know what is a Multilayer perceptron and Feedforward neural network as well. In case you don’t, no worries, Google is your friend :stuck_out_tongue_winking_eye:.

Keras is a high-level neural networks library for TensorFlow and Theano. I would call it a Python wrapper that hides the extra details necessary to create neural networks... simplifying our life!

Since I’ve just learned how to create Github Markdown check boxes, let’s write down an outline of what we want to achieve at the end:

  • Convince ourselves learning Keras is a nice investment!
  • Create our very own first deep neural network (ok, not that deep) applying it to a well known task.
  • Show off by modifying the previous example using a convolutional layer.
  • Enjoy our time because when you work on something you like, it is not work anymore!

Read more...

My Old Projects or Why You Should Document and Share Your Stuff Online

Today, I’ve decided to write something to make sure I’m not going to forget, again, about my old projects. Another reason for this post is to be an incentive for sharing / publishing your work online. If I had published everything online, as I was developing, I would not need to write a post about things from the past like I’m doing right now ;)  

When I was still an undergrad student (2000-2005), mobile phones with good quality cameras were not available and only in 2004 (or 2005?) I got one with a really noisy, probably VGA, camera. I was only able to have such a phone because I found an unsolvable bug on my old one, while still on guarantee, and they had no choice but give me a better one (Brazil has some really nice consumer protection laws). Also, Dropbox, GoogleDrive, etc were not available and it was quite common to lose data from time to time after a problem with a hard drive.

During my years as an undergrad Electrical Engineering student, I’ve developed some interesting projects, but most of them I’ve not saved any picture, schematic, etc. For one of my analog electronics modules, my group designed a circuit to multiply two input signals using only transistors. I still remember that Analog Devices had one IC that could do exactly what we struggled to build for that module. The control systems module demanded us to develop an analog PID controller and I implemented a controller for CPU fans. Later on, I’ve worked on a Neural Network implementation using FPGA that should be able to recognise simple numbers. All those projects are lost, since I don’t have backup of anything or photos. My first project to have a digital picture saved was during the microcontrollers module. My group designed a home automation system, based on 8051, where you could activate relays through DTMF. Here is the picture (we recycled my old 56K USRobotics faxmodem plastic enclosure):

DARVIT
DARVIT - 8051 based home automation system.

Read more...

Hello, World!

This is my first attempt using Jekyll. It all started because my colleague, Massimiliano, showed me his brand new Jekyll based website. Actually, I’d tried Jekyll before, but when I read the first lines asking me to install Ruby, RubyGems, NodeJS and then install Jekyll, I instantaneously gave up. I was way too used to deploy and admin WordPress websites, so I could not accept the idea of not being able to have a web-only system. Luckily, Github does everything and it’s NOT necessary to install anything on you computer to use Jekyll with Github!

My plan, for the future, is to keep this website updated with what I’m currently doing (and, maybe, try to document some old projects too).

And, finally, here it is:

Hello, World!

This website was created using the Lanyon theme.