Wednesday, May 17, 2017

Neural Networks: Teaching Computers to Teach Themselves

Neural Networks: Teaching Computers to Teach Themselves
Computer-generated music and much more!
By Russell Miles

Computers have become increasingly powerful over the past few decades. These devices can store many terabytes of data, solve math problems instantly, and win games of chess against the most skilled grandmasters. However, until recently, humans and computers have been separated by one fundamental trait: the ability to learn. Today, through the use of neural network technology, computers are able to learn through a process of trial and error just like we do.

History of Neural Networks

Model of a neuron (image source).

Believe it or not, the first neural network was actually invented in order to help explain the human brain. In 1943, neuroscientist Warren McCulloch and mathematician Walter Pitts built a simple electrical circuit to demonstrate how human neurons work. Today, McCulloch-Pitts (or MCP) neurons are used in all sorts of computer programs. They take in information from other neurons and send a yes- or no-signal based on this information. When stringed together, MCP neurons can allow computers to make complex decisions. This video explains how they work.

Like a hedge artist trims plants into shapes, the brain trims its neurons as it absorbs information (image source).

For humans and computers, learning takes a lot of practice. Although artificial neurons existed in the early days of computing, they did not catch on until much later. This is because a huge amount of data is needed to "train" a neural network. First, programmers enter a large amount of data for the neural network to read. Next, the computer uses the data to start "guessing" at how to solve a specific problem posed by the programmers. After each guess, the program will slowly improve by editing and trimming its neurons.  

For any skill, practice makes perfect (image source).

If this process sounds familiar, it's because you do it every day. When practicing a skill or solving a problem, you take in your surroundings, try new things, make minor changes, and then try again. This artist started out with very little knowledge of the craft, but they were able to improve by drawing many pictures. Neural networks follow a similar process, starting out with random, poor-quality results and eventually working towards a useful solution. To understand the impact of neural networks, we will have to look at some examples.


Images taken from the following video.

In this video, designers created 3D frameworks for a variety of creatures. Using a neural network, a computer built muscle structures based on a desired walking speed for the creatures. At this point, you can see that the computer's first few designs failed spectacularly. However, after lots of practice and nine-hundred and twenty failed designs, the computer created a design that can walk like a human. Later on, the designers add some more variables and creatures into the mix.

Classical composer Johann Sebastian Bach (image source).

This video shows the training of a neural network using the works of Johann Sebastian Bach. Hundreds of MIDI files of Bach's piano pieces were fed to a network which rearranges the notes into a piano piece. On the first try, the program only plays one note before stopping. After 100 iterations, the network seems to be playing notes at random. After tens of thousands of tries, the compositions finally start to resemble classical music. If someone with no knowledge of music wanted to teach themself to play like Bach, this is what the process might sound like. For more detailed information about this process, as well as several computer-generated piano compositions, check out the full report here.

Images altered using Dreamscope (Original image in top left).

If you don't want to pay an artist to make pop-art paintings of your cat, you can use an online neural network program. Dreamscope is free, and allows you to turn any image into a work of art. This program, and others like it, look for patterns in your image that are similar to patterns within a chosen filter image. After scanning for the first time, the neural network will continue to scan for similar patterns until they are found. This allows the computer to intelligently shade each part of an image. Learn more about pattern recognition in neural networks here.

More Resources

If these examples of neural networks excite you, check out these links for more interesting uses of the technology.

Evolution of aquatic robots -- A video about optimizing aquatic animal designs.

Google's Computers are Making Thousands as Artists -- Fortune article about the sale of computer-generated art.

Inside an Artificial Brain -- Trippy and terrifying visuals created by a neural network using source images of dogs, lizards and other things.

Two Minute Papers -- An interesting YouTube channel focusing on A.I. and computer graphics.

DeepLearning.TV -- An educational video series about neural networks and A.I. in general.

Thank you for reading. Keep following for more informational posts and updates on recent trends in technology.

Works Cited

Marsalli, Michael. "The Mind Project." McCulloch-Pitts Neurons (Overview). National Science
Foundation Grants, n.d. Web. 02 May 2017.

Tuesday, May 9, 2017

Technology And Economics in Sichuan Province, China

How China is using international partnerships and advanced technology to compete in a competitive global market

By Thomas Jeffrey

The words Sino-German are proudly emblazoned on the royal red containers handed to us as we exit the dusky industrial park.  Upon opening the aluminum to examine the contents, I am immediately taken aback, for a tooth lays nestled before me.  Not a real tooth I come to realize, but a delicately designed and manicured 3D printed piece of the future.  Hand crafted by the generous employees of DT Dental, one of the world’s, let alone Chengdu’s, premier orthodontic technologists. I admire the piece all the way back to my hotel.  
18403630_123732518187860_2718865412701726156_n.jpgThe significance of Sino-German is realized in the story of China’s economy some forty years ago.  Following significant market reforms in 1978, China has slowly worked its way up into one of the largest economic powers of the world.  Hard workers, intelligent craftsman, and cheap labor drew many foreign investors to China.  In this spirit, DT Dental was founded in 1995 to take advantage of recent German technology to manufacture high quality dentures at affordable prices.  
18402681_123732468187865_7189988670779919873_n.jpgUsing cutting edge 3D Design Programs, printers, and painting techniques, DT Dental is able to make an astonishingly real product.  See the recent blog post by Russell Miles to learn more on the different kinds of 3D printers, all of which are used to some extent at DT Dental, including, but not limited to, Stereolithography, Selective Laser Sintering, and Selective Laser Melting.  
Factory floor employees, some of whom are only sixteen or seventeen years old, take advantage of many of the same tools available to us in the Hack Shack right now.  Coming from some of the poorest families in the greater Chengdu area, DT Dental utilizes Confucius teachings to gives these kids the tools they need to succeed in the professional world.  
This system, which teaches the kids respect to parents, critical thinking, and financial literacy, actually better prepares them for fulfilling lives and careers than many of the local public schools could do, according to Chengdu native, Rubio Dan.  To many westerners, the idea of beginning one’s professional life at just sixteen is heartbreaking, but to these children, it is a dream come true.  
DT Dental is admittedly an unusual business in China today.  Not many choose to pay for all room and board for their employees.  Even fewer decide to respect them enough to treat them like family and place values above overall profit, but they do.  Much of this ability to conduct business in this way is attributed to the high degree of technology that they use, which increases productivity and quality immensely.  The truth is that these kinds of highly skilled jobs better prepare workers to either move up the corporate ladder, or attain greater financial independence for themselves in the future.  

Wednesday, April 19, 2017

Monday, April 17, 2017

A Three-Dimensional Look at 3D Printing Processes

By Russell Miles

A spaceship model that I created using our Makerbot Replicator FDM printer.

If you've been following the Hack Shack blog for a while, you've probably read a lot about 3D printers. Along with the basics of 3D modeling, we have talked about 3D printed food and 3D printed prosthetics. However, we haven't gone into detail about how our own 3D printer works.

All 3D printers have a few things in common. Nearly all of them use files from Computer Assisted Design (CAD) programs as blueprints to create objects. Most 3D printers build objects piece by piece, either in layers or in small sections. Aside from these few similarities, 3D printers can be vastly different from each other. Let's take a look a few of the most common 3D printing processes and the steps they take to create a finished product.

Fused Deposition Modeling (FDM)

The MakerBot Replicator, which can be seen in the ORHS Hack Shack (image source).

Fused Deposition Modeling, the most common type of 3D printing, is used in the Hack Shack's MakerBot Replicator. FDM printers use heated plastic to construct objects one layer at a time. An extruder moves horizontally to put the melted plastic in place, and a flat printing bed moves downward as each layer is completed. Picture a tube of frosting moving back and forth, drawing multi-layered designs on a cake. Because these printers build objects vertically, plastic supports are sometimes added to the model. These can be removed after the print.

FDM printers are solid all-around printers because of their fast build times and their ability to print using production-grade plastic. These printers won't break the bank, with some available for a few hundred dollars. Check out this video for a closer look.

Selective Laser Sintering (SLS)

A product of SLS printing before the removal of excess powder (image source).

Unlike FDM printers, Selective Laser Sintering printers don't leave behind support structures or noticeable layer lines. This makes the process ideal for complex parts. A guided laser beam is shot into a bed of powdered material, causing the powder to fuse into a solid object. After one layer of the object is complete, more powder is added to the top. The end products of SLS printing have smooth, uniform surfaces, and can be made of hard nylon, glass, or even metal.

Also unlike FDM printers, SLS printers are very expensive. Most SLS machines cost tens of thousands of dollars, restricting them to industrial use. However, some websites allow you to order SLS-printed parts online. Watch this video explaining the process, or this video in which designers use SLS to print a wearable plastic dress.

Stereolithography (SLA)

Statue produced using stereolithography (image source).

This 3D printing process is the affordable cousin of SLS. While SLS uses powdered material, SLA uses liquid resin that hardens when it comes into contact with a guided laser. Because the resin is not as sturdy as the powder used in SLS, support structures are needed. After the resin is hardened, the supports are removed using a chemical bath. Some SLA materials need to be placed in an ultraviolet oven to harden. This video describes the process more clearly.

One advantage of SLA is the laser's ability to craft finer details than the extruder of an FDM printer can produce. However, while the strong plastic of FDM printers can be used for final products, SLA is typically only used for prototypes or molds. Desktop SLA printers are smaller than most FDM printers, and cost a few thousand dollars.

Other Processes

Product of Laminated Object Manufacturing (image source).

Many printing methods have smaller subcategories. Digital Light Processing (DLP) is similar to stereolithography, but it uses light that is focused using tiny micro-mirrors. Selective Laser Melting (SLM) printers use the SLS process to melt and solidify metal powder, while Electronic Beam Melting (EBM) uses a beam of electrons instead of a laser. Laminated Object Manufacturing (LOM) uses layered plastic sheets to create objects.

Which 3D Printing Process is Right for You?

A 3D bust of Star Wars' Yoda (image source).

If you want to explore 3D modeling as a hobby, you can't go wrong with FDM. The affordability of FDM printers make them ideal for hobbyists, and they can be used to create model figurines or end-use products. You can read our post about painting scale models made with FDM here.

If you want to use 3D printing to create intricate pieces of art, you may want to consider an SLA printer. These are slightly more expensive than FDM printers, but the extra precision may be worth the higher price tag. Keep in mind that SLA-printed objects are not as durable as FDM-printed ones.

If you want to use a 3D printer for manufacturing, SLS is your best bet. These printers can create objects out of multiple materials, and their durability and precision are unmatched. However, for the average person who doesn't need a printer more expensive than their car, it is better to order SLS-printed models online.
Whether you are looking to start 3D printing, or you just want to learn more about this revolutionary technology, I hope this post was helpful. Keep following for more information on 3D modeling and printing technology.

Sunday, April 16, 2017

Science fiction, or just Dubai?

By Tom Jeffrey

When the Chinese Tech Firm EHang plans to bring drone taxis to the skies of Dubai, we have to wonder.

Conceived in the bustling city street of Guangzhou, China in 2014, EHang set out with the goal to “Let Humankind Fly Freely Like A Bird”.  After receiving crowdfunding later that year for their successful GHOST DRONE 1.0, EHang became a leader in smart drone technology, producing top of the line consumer drones.  Having set up offices in both California, U.S.A. and Dusseldorf, Germany, the company has grown into an international frontrunner.  Their most ambitious project, pictured above, is unlike any product that has ever come before it.  Their concept is to totally revolutionize city travel by eliminating the four wheeled, two ton, space consuming taxi car and replace it with your very own personal drone taxi.  
EHang recently signed a contract with the government in Dubai to bring a fleet of these drone taxis to the city's affluent, high tech business community.  They expect these machines to become quite popular, as conventional car travel on the road can be expensive, in both time, and money.  
Though undoubtedly high tech, the premise behind such a product is quite simple.  After having perfected the commercially conventional sized drones, capable of carrying a video camera, they simply seek to enlarge the design and make it comfortable for human habitation.  Prominent on all EHang designs are the signature “over-under” propeller design, which work to minimize instability caused by rotational torque from the motor.  A series of lithium ion batteries carry the craft for a total of 30 minutes flight time, enough for several trips within a city, such as Dubai.  
Just as conventional drones are controlled from the ground, each taxi will be controlled by computer software, and overseen by a group of specialists on the ground.  
Testing has been going on consistently for the past two years, and reports are highly successful.  EHang recently did a public demo in Las Vegas, Nevada, to showcase the new technology.  
This highlights a trend towards automation that has been increasingly prevalent in past decades.  While many industries, like automobiles, may be slow to transfer over to self-driving methods, completely new industries, like air taxies, are being born into it.  People do not have the preconception that they should be able to drive the flying machine themselves as we do with four wheeled automobiles.  People are used to having others take the wheel on airplanes, so the continuation of such a trend should be of no issue.  Many people are still worried about the safety of such a craft, however.  
This also signals the advancement of lightweight, high capacity batteries that will allow for greater proliferation of electric vehicles in the future.  

Saturday, March 11, 2017

AutoHotkey: Reprogramming Your Keyboard

By Russell Miles

As technology becomes increasingly customizable, the traditional computer keyboard remains surprisingly restrictive. Keys cannot be easily rearranged, and useful functions are often hidden behind long strings of keys that are difficult to remember. However, this can all be changed with AutoHotkey: a free and easy-to-learn software that allows you to reprogram your computer keyboard in any way imaginable.
Getting Started

After downloading AutoHotkey, the easiest way to create a new script is to right-click on your desktop. Mouse over the "New" menu and select "AutoHotkey Script."

Right-click your new file to select "Edit script" and you are ready to go!

A finished script can be activated by double-clicking it on the desktop, or right-clicking and selecting "Run script." When you are done using your script, navigate to the taskbar to find the green "H," right-click, and select "exit."

Here are just a few things that you can accomplish using this program:

1) Experiment with new keyboard layouts.

Everyone is familiar with the classic QWERTY keyboard, but some people believe that other keyboard layouts are faster or more efficient. Autohotkey allows you to make changes as simple as switching two keys, or as complicated as rearranging your entire keyboard.

To create a new hotkey, enter the key you want to replace followed by two colons (::). After the colons, enter the key's new function. Here is a script that replaces the "Q" key with the "A" key:
Simple, right? Now you can proceed to make any changes you want. This script replaces the QWERTY layout with one that puts all keys in alphabetical order.

Once you have rearranged your keyboard, save your script through the "File" menu just as you would with a Word document. Remember that you have to activate your script to get it to work.

2) Manipulate the mouse.

Placing mouse functions on other keys can make your laptop more comfortable to use during long Internet-surfing sessions. The "WheelUp," WheelDown," "WheelLeft," and "WheelRight" functions allow you to scroll up, down, left and right. "LButton" and "RButton" refer to the mouse buttons. This script allows you to scroll up and down, as well as left- and right-click, with the top four buttons of the keyboard.

You can also experiment with MouseMove, MouseClickDrag, and several other functions for more advanced mouse operations.

3) Replace misspelled words using Hotstrings.

Sometimes, the spell-check in Microsoft Word or Google Docs just doesn't cut it. It's annoying to drag your mouse back to fix a squiggly red line after every typo. By using hotstrings, you can replace a string of keys with other functions. Instead of the single pair of colons following hotkeys, hotstrings are surrounded by two pairs of colons.

While this script is running, "omw" will be replaced with with "on my way." Capitalization is preserved, so "Omw" will give you "On my way" instead. Now you can add a personalized version of your smartphone's autocorrect to your computer.

I used my own autocorrect script while writing this post. With hotstrings, you'll never have to deal with these annoying typos again!

4) Activate a string of keys using a single command.

Here's where things can get really interesting. The "Send" functions allow you to program a hotkey to input a long series of keys. Try out this script that programs the "0" key to type a message:

Most keys can be activated in this way, but some require special codes. If you want to use this
function to press other keys like "Shift," "Alt," "Enter," or "Ctrl," you will have to put them in brackets.

This script holds down and releases the "Alt" and "F4" keys to replicate Alt+F4, a function that closes your current program. If you don't want to give up one of your keys to perform this function, you can create a function of your own.

Now, pressing Alt+X will function exactly the same as Alt+F4. The exclamation point is a code for "Alt" when used in a hotkey. Check the links at the end of this post for other codes.

5) Use custom functions to run programs.

If you want to go beyond the limits of Ctrl+C, Ctrl-V, Alt+Tab, and all the other familiar keyboard functions, you can use AutoHotkey to make your own. The "Run" function allows you to set hotkeys to run a variety of files.

Simply type "run," after a hotkey, then enter the name of a file on your computer. This script sets Alt+T to run Task Manager, Alt+C to run the Calculator app, Alt+N to run the Notepad, Alt+M to run Windows Media Player, Alt+G to run Google, and Alt+S to run the Snipping Tool. Notice that a select few websites, including Google, can be opened using the Run function. Alt+S helped me quickly capture screenshots of my scripts for this post.


These are just a few of the things you can accomplish with AutoHotkey, but the possibilities are endless. AutoHotkey's online database is extremely useful, as it has pages for every function. If you are interested in experimenting with AutoHotkey, read the useful tutorials here and here for more information.

Happy Hotkeying!