Ketan's Home

October 31, 2018

My Journey Towards Machine Learning

Filed under: Uncategorized — ketan @ 7:35 AM

Telling the computer what to do is fun, but have you ever wondered how you can simply tell the computer one thing and it extends to another thing? I mean allowing the computer to make future executions without having to wait for exclusive commands from the programmer. Oh yeah, allowing the computer to indirectly make inference without waiting for input from the programmer.

As a software developer for the past three years, I have always given direct instructions to the computer, but then I began to ask whether we could give fewer instructions to the computer and get more output. I began this thought path a few months back, and it has led me to machine learning, the field where you can basically teach a computer to learn.

It is more than simply teaching the computer to learn; it is about setting the computer up to serve as a knowledge sponge so that it accumulates any information that comes its way. Resources about machine learning abound on the internet, but from my own experience, I want to shed a little light on the basic ideas and the most important things to focus on.

Machine Learning

What Is Machine Learning?

When you started out in school, you learned things by first being introduced to them and, after a while, by answering questions about them. You basically learned from data.

Probably you remember the first time you tried to identify an animal or a letter of the alphabet and you missed it? It took you one or more tries to fully learn, and from there, you became an alphabet or animal identifier.

The same thing happens with machine learning.

Machine learning is teaching computers to learn from data. It basically involves exposing computers to data and allowing the computer to make decisions and suggestions based on the data. The computer is exposed to some letters or to some animals, and after a while, the computer is asked to identify them.

In essence, machine learning sets up a system where the software learns for all the days of its life as long as the computer is exposed to more data. To learn is to able to make inference about new information from previous information.

The examples that are used to teach the computer are called the training set. Each example is known as the training instance. Simply storing information in your memory without making inference from it is not considered learning.

What’s the Difference Between Machine Learning and a Normal Computer Program?

A computer program is usually a step-by-step instruction of how a computer should behave. A human determines the exact steps and gives those steps to the computer to execute. As such, the computer does not make new inference beyond what the programmer has written.

However, machine learning involves giving the computer the basic rules it needs to execute a task and then leaving it to continue learning on its own. The operations of a machine learning program are not always controlled by a human.

Due to this capability, a spam-filtering, machine-learning program does not wait for a human to tell it how to classify every single email it receives; it simply learns from the data it was exposed to. If the data changes, the computer is able to understand the change and adjusts to the change automatically.

What Fields Does Machine Learning Apply To?

Machine learning is applicable in fields where tasks are executed based on data. For example, it can be applied to law, since lawyers have to make cases based on data. It can be applied to medicine, since doctors have to prescribe medications based on data about patients. So essentially, machine learning can be applied to any field where data are generated and where experience is based on access to more data.

For software development, machine learning leans toward understanding how programmers write code so that programmers can write less and better code. In the area of infrastructure on which our software runs, machine learning can help improve understanding when the infrastructure has too much load to process and can indicate how that can be improved. Also, areas like design can be greatly improved.

Types of Machine-Learning Systems

Machine learning can be classified based on different paradigms. Some are:

  1. Human supervision
  2. Data acquisition rate
  3. Generalization method

Human Supervision

Machine learning can be classified into four categories under this paradigm:

Machine Learning
Supervised Learning: While teaching kids the alphabet, a teacher shows the letter and gives its name. The teacher gives the letter and also labels it. Since a teacher supervises when this learning is taking place, it is called supervised learning.

In machine learning, data passed to the computer contains the desired solution. The desired solution is called the label. The label serves as the teacher during the learning process.

Supervised learning can be categorized into classification and regression. In classification, the system learns to classify data into one class or another, while in regression, the system learns to produce a number for a certain input.

Unsupervised learning: When a teacher is not available to guide and supervise your learning, it is termed unsupervised learning. So in machine learning, it means the data supplied to the computer are not labeled. Usually, the computer finds patterns on its own. Some types of unsupervised learning include clustering, dimensionality reduction (feature extraction), anomaly detection, and association-rule learning.

  • Clustering – grouping unlabeled data into similar groups based on certain patterns detected by the machine-learning program.
  • Dimensionality reduction – reducing the number of features used in the training example or simply grouping related features into smaller numbers. This is usually a necessary step before passing on training examples to other machine learning algorithms.
  • Association-rule learning – digging through large amounts of data and discovering interesting relationships between attributes.
  • Anomaly detection – detecting anomalies or outliers in data.

Semi-supervised learning: This simply combines supervised and unsupervised learning. It means that some of the data passed to the computer are labeled, while some others are unlabeled. Usually, there is more unlabeled data than labeled data.

Reinforcement learning: Remember when you started learning to play a certain game? The things you learned were the things to avoid so that you did not end your game. You learned things that improved your life span and ran away from things that sought to harm you. It’s the same in reinforcement learning.

The learning environment contains an agent that finds the right actions to perform and is rewarded or punished based on the tasks. It simply seeks to find what the best line of action (known as the policy) is to take at every point. So in the game analogy, the player is the agent, and the tricks or steps to avoid being killed are called the policies.

Data Acquisition Rate

To learn, you need data, and the rate at which you get and consume data is one of the categories of classification for machine learning. Under this category, there is batch (one time) and online (incremental) learning.

Batch or one-time learning: The system is trained in a single batch with all the available data. If new data are available, the old and new data are combined together into one batch, and the system is trained again from scratch. As such, this method takes a lot of time and resources and is done offline, hence the name offline learning. After training, the system is deployed online again for use.

Online or incremental learning: The system continuously learns from new data, not from a single batch, like in batch learning. In this case, the system keeps learning without having to stop to retrain. It continuously learns. The data are fed in individually or in small groups or batches.

Generalization Method

Under the generalization paradigm, machine learning can be divided into instance-based and model-based learning.

Instance-based: Learning is done by comparing new data with data already stored in memory.

Model-based: Rather than learning from stored training examples, we can decide to build a model based on them. From the model, we can make predictions. This is called making an inference.

The Time to Start Is Now: Integrate Machine Learning Today

Machine learning is all about data and patterns, and if you look at what software development is about, you’ll see it’s the same thing. It is important that software developers begin to look at how they can integrate machine learning into their daily activities. For designers, machine learning helps you better understand how your users interact with your design and how it can be improved.

For software developers, machine learning helps you build intelligent systems. Machine learning makes software development more about building an intelligent machine than a machine that simply expects input all the time from the user. In essence, machine learning is about making intelligent systems, not just garbage in, garbage out systems.

And the time is now for every software developer to understand the beauty of machine learning and how it can be applied to their daily tasks.

from Java Code Geeks

October 29, 2018

Open Data Cam Combines Camera, GPU, and Neural Network in an Artisanal DIY Cereal Box

Filed under: Uncategorized — ketan @ 11:00 PM

The engineers and product designers at [moovel lab] have created the Open Data Cam – an AI camera platform that can identify and count objects as they move through its field of view – along with an open source guide for making your own.

Step one: get out your ruler and utility knife. In this world of ubiquitous 3D-printers they’ve taken a decidedly low-tech approach to the project’s enclosure: a cut, folded, and zip-tied plastic box, with a cardboard frame inside to hold the electronic bits. It’s “splash proof” and certainly cheap to make, but we’re a little worried about cooling and physical protection for the electronics inside, as they’re not exactly cheap and rugged components.

So what’s inside? An Nvidia Jetson TX2 board, a LiPo battery with some charging circuitry, and a standard webcam. The special sauce, however, is the software, which is available on GitHub. [Moovel lab]’s engineers have put together a nice-looking wifi-accessible mobile UI for marking the areas where you’d like the software to identify and tally objects. The actual object detection and identification tasks are performed by the speedy YOLO neural network, a task the Nvidia board’s GPU is of course well suited for.

As the Open Data Cam’s unblinking glass eye gazes upon our urban environments, it will log its observations in an ancient and mysterious language: CSV. It’s up to you, human, to interpret this information and use it for good.

A summary video and build time lapse are embedded after the break.

[via Creative Applications Network]

from Hack a Day

October 27, 2018

A Multifunction ESP8266 Smartwatch

Filed under: Uncategorized — ketan @ 10:54 PM

Most of the DIY smartwatch projects we feature here on Hackaday aren’t exactly what most people would consider practical daily-use devices. Clunky designs, short battery life, limited functions: they’re more a wearable display of geek cred than they are functional timepieces. Oddly enough, the same could be said of many of the “real” smartwatches on the market, so perhaps the DIY versions are closer to the state-of-the-art than we thought.

But this ESP8266 smartwatch created by [Shyam Ravi] is getting dangerously close to something you could unironically leave the house with. It’s still missing an enclosure that prevents you from receiving PCB acupuncture while wearing it, but beyond than that it has a more than respectable repertoire of functions. It even seems to be a fairly reasonable size (with the potential to be even smaller). All that with a total build cost of less than $20 USD, and we’re thinking this might be a project to keep an eye on.

Not content with a watch that simply tells the time, [Shyam] added in a weather function that pulls the current conditions for his corner of the globe from the Yahoo weather API and displays it above the time and date on the watch’s multi-color OLED display when the center button is pressed. Frankly, given the state of DIY watches, that would already have been impressive enough; but he didn’t stop there.

The left and right buttons control Internet-connected relays which [Shyam] uses to turn his lights and air conditioner on and off. When he presses the corresponding button, the watch will even display the status of the devices wherever his travels might take him.

A smattering of DIY watches pass by our careful gaze, though it’s been a while since we’ve seen an ESP8266 watch. More recently we’ve seen an Arduino watch, and some downright gorgeous analog creations.

[Thanks to BaldPower for the tip.]

from Hack a Day

October 17, 2018

NES Music Emulated on an ESP32 Microcontroller @lixielabs #Nintendo #NES

Filed under: Uncategorized — ketan @ 10:51 PM

NES Music Emulated on an ESP32 Microcontroller @lixielabs #Nintendo #NES

Connor Nishijima at Lixie Labs brings us emulated Nintendo NES music using the inexpensive ESP32 and the Arduino IDE!

I’ve taken the chore upon myself to emulate the quirky Ricoh 2A03 APU from the Nintendo Entertainment System on an ESP32! (Using the horribly inconsistently labeled APU information at

I’m sharing a library which now lets you take almost any NES music from and play it on command with an ESP32 with nothing but a speaker and some wires. 🙂

The “Cartridge” library is here:

Make a robot friend with Adafruit’s CRICKIT – A Creative Robotics & Interactive Construction Kit. It’s an add-on to our popular Circuit Playground Express, FEATHER and other platforms to make and program robots with CircuitPython, MakeCode, and Arduino. Start controlling motors, servos, solenoids. You also get signal pins, capacitive touch sensors, a NeoPixel driver and amplified speaker output. It complements & extends your boards so you can still use all the goodies on the microcontroller, now you have a robotics playground as well.

Join 7,500+ makers on Adafruit’s Discord channels and be part of the community!

CircuitPython in 2018 – Python on Microcontrollers is here!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more

Maker Business — Rethink Robotics closes shop. Long live collaborative robots #makerbusiness

Wearables — Zip it up

Electronics — Serial overkill

Biohacking — Biohacking Resources – Books, Talks and Podcasts

Python for Microcontrollers — CircuitPython creates new assistive tech opportunities

Get the only spam-free daily newsletter about wearables, running a “maker business”, electronic tips and more! Subscribe at


No comments yet.

Leave a comment

Adafruit has a “be excellent to each other” comment policy. Help us keep the community here positive and helpful. Stick to the topic, be respectful of makers of all ages and skill levels. Be kind, and don’t spam – Thank you!

from Adafruit Blog

October 6, 2018

A New Tilt on RC Car Controllers

Filed under: Uncategorized — ketan @ 10:44 AM

A New Tilt on RC Car Controllers

If you are a lover of all-things remote-conteolled, it’s likely that you know a thing or two about controllers. You’ll have one or two of the things, both the familiar two-joystick type and the pistol-grip variety. But had you ever considered that there m ight be another means to do it? [Andrei] over at ELECTRONOOBS has posted a guide to a tilt-controlled RC car. It is a good example of how simple parts can be linked together to make something novel and entertaining, and a great starter project for an aspiring hacker.

An Arduino Nano reads from an accelerometer over an I2C bus, and sends commands over a wireless link, courtesy of a pair of HC-12 wireless modules.  Another Nano mounted to the car decodes the commands, and uses a pair of H-bridges, which we’ve covered in detail, to control the motors.

The tutorial is well done, and includes details on the hardware and all the code you need to get rolling.  Check out the build and demo video after the break.

We’d love to see this idea turned up to 11 by using a more capable base vehicle, and finer controls on the steering– A Honda Civic perhaps?

[Thanks to Baldpower for the tip!]

from Hack a Day

Blog at