Skip to main content

Blog

Learn About Our Meetup

5000+ Members

MEETUPS

LEARN, CONNECT, SHARE

Join our meetup, learn, connect, share, and get to know your Toronto AI community. 

JOB POSTINGS

INDEED POSTINGS

Browse through the latest deep learning, ai, machine learning postings from Indeed for the GTA.

CONTACT

CONNECT WITH US

Are you looking to sponsor space, be a speaker, or volunteer, feel free to give us a shout.

Author: torontoai

A Magnetosphere for Neural Networks

The LogAdam Optimizer

Planetary defence against massive gradient spikes

Neural networks learn by iteratively updating their weights.

This is usually not a problem — an amount based on the gradient of the error is back-propagated through the network, weights are updated and progress is made. All is peaceful for the AI.

Occasionally, however, the neural network can enter an area where the loss function has an immense sharp gradient. This amount, when propagated back through the network, destroys the delicate patterns found in earlier steps and the damage seriously sets back training and the performance of the model.

Drawing an analogy to the Sun, the Sun allows for life to evolve on Earth, and at the same time we have a magnetosphere that protects the planet from the occasional massive solar flare. In the same way, neural networks need a magnetosphere.

One approach is to cap extreme gradients by just clipping them, setting a maximum limit to the gradient. However this has a couple drawbacks — the first is that it is challenging to find an appropriate limit (an extra hyperparameter to worry about), and secondly, the neural network loses information about the magnitude of the gradient if it is beyond that limit.

Instead, what if we just scaled the gradient to its logarithm? In that case, each order of magnitude increase in the gradient only adds a constant amount to the back-propagated signal. This is the magnetosphere for your neural network. It can handle massive gradients with ease.

Specifically, we join the two logarithmic functions below at the origin to create a smooth monotonic scale that we use to dampen the gradient, and, in doing so, we protect the network.

Instead of sending back the value itself (represented by the y=x blue line) we send back the the logarithm of it (+1) instead.

In TensorFlow, the gradient of the loss function can be dampened as follows, before sending it back through the network:

TensorFlow:

protected_grad = tf.sign(grad) * tf.log( tf.abs(grad) + 1. )

You can use this technique with any optimizer but often one of the best is the AdamOptimizer. Extending it in this simple way gives us the LogAdamOptimizer.

Does it work? Absolutely! I am using this approach in a 46-layer GAN to generate flowers, here are some samples from around iteration 140k where all gradients are ‘log-dampened’ gradients (i.e. using a LogAdam optimizer):

Enjoy, happy training.

I’ll have more to post about GAN training — follow if you are interested in learning more about them!

Dave MacDonald

Toronto AI

Toronto AI

Reinforcement Learning

ecobee’s very own Haotian Zhang will be speaking about reinforcement learning!

Haotian Zhang is an AI researcher at ecobee Inc., developing innovative AI solutions and efficient machine learning techniques for smart homes. He is also working on building context-aware and agent-based AI systems. Before that, he worked on control and optimization of multi-agent systems and received his PhD degree in Electrical and Computer Engineering from University of Waterloo.

More details will follow!

 

https://www.meetup.com/Toronto-AI/events/245321619/

AlphaGo, in context

Update Oct 18, 2017: AlphaGo Zero was announced. This post refers to the previous version. 95% of it still applies.

I had a chance to talk to several people about the recent AlphaGo matches with Ke Jie and others. In particular, most of the coverage was a mix of popular science + PR so the most common questions I’ve seen were along the lines of “to what extent is AlphaGo a breakthrough?”, “How do researchers in AI see its victories?” and “what implications do the wins have?”. I thought I might as well serialize some of my thoughts into a post.

The cool parts

AlphaGo is made up of a number of relatively standard techniques: behavior cloning (supervised learning on human demonstration data), reinforcement learning (REINFORCE), value functions, and Monte Carlo Tree Search (MCTS). However, the way these components are combined is novel and not exactly standard. In particular, AlphaGo uses a SL (supervised learning) policy to initialize the learning of an RL (reinforcement learning) policy that gets perfected with self-play, which they then estimate a value function from, which then plugs into MCTS that (somewhat surprisingly) uses the (worse!, but more diverse) SL policy to sample rollouts. In addition, the policy/value nets are deep neural networks, so getting everything to work properly presents its own unique challenges (e.g. value function is trained in a tricky way to prevent overfitting). On all of these aspects, DeepMind has executed very well. That being said, AlphaGo does not by itself use any fundamental algorithmic breakthroughs in how we approach RL problems.

On narrowness

Zooming out, it is also still the case that AlphaGo is a narrow AI system that can play Go and that’s it. The ATARI-playing agents from DeepMind do not use the approach taken with AlphaGo. The Neural Turing Machine has little to do with AlphaGo. The Google datacenter improvements definitely do not use AlphaGo. The Google Search engine is not going to use AlphaGo. Therefore, AlphaGo does not generalize to any problem outside of Go, but the people and the underlying neural network components do, and do so much more effectively than in the days of old AI where each demonstration needed repositories of specialized, explicit code.

Convenient properties of Go

I wanted to expand on the narrowness of AlphaGo by explicitly trying to list some of the specific properties that Go has, which AlphaGo benefits a lot from. This can help us think about what settings AlphaGo does or does not generalize to. Go is:

  1. fully deterministic. There is no noise in the rules of the game; if the two players take the same sequence of actions, the states along the way will always be the same.
  2. fully observed. Each player has complete information and there are no hidden variables. For example, Texas hold’em does not satisfy this property because you cannot see the cards of the other player.
  3. the action space is discrete. a number of unique moves are available. In contrast, in robotics you might want to instead emit continuous-valued torques at each joint.
  4. we have access to a perfect simulator (the game itself), so the effects of any action are known exactly. This is a strong assumption that AlphaGo relies on quite strongly, but is also quite rare in other real-world problems.
  5. each episode/game is relatively short, of approximately 200 actions. This is a relatively short time horizon compared to other RL settings which may involve thousands (or more) of actions per episode.
  6. the evaluation is clear, fast and allows a lot of trial-and-error experience. In other words, the agent can experience winning/losing millions of times, which allows is to learn, slowly but surely, as is common with deep neural network optimization.
  7. there are huge datasets of human play game data available to bootstrap the learning, so AlphaGo doesn’t have to start from scratch.

Example: AlphaGo applied to robotics?

Having enumerated some of the appealing properties of Go, let’s look at a robotics problem and see how well we could apply AlphaGo to, for example, an Amazon Picking Challenge robot. It’s a little comical to even think about.

  • First, your (high-dimensional, continuous) actions are awkwardly /noisily executed by the robot’s motors (1,3 are violated).
  • The robot might have to look around for the items that are to be moved, so it doesn’t always sense all the relevant information and has to sometimes collect it on demand. (2 is violated)
  • We might have a physics simulator, but these are quite imperfect (especially for simulating things like contact forces); this brings its own set of non-trivial challenges (4 is violated).
  • Depending on how abstract your action space is (raw torques -> positions of the gripper), a successful episode can be much longer than 200 actions (i.e. 5 depends on the setting). Longer episodes add to the credit assignment problem, where it is difficult for the learning algorithm to distribute blame among the actions for any outcome.
  • It would be much harder for a robot to practice (succeed/fail) at something millions of times, because we’re operating in the real world. One approach might be to parallelize robots, but that can be quite expensive. Also, a robot failing might involve the robot actually damaging itself. Another approach would be to use a simulator and then transfer to the real world, but this brings its own set of new, non-trivial challenges in the domain transfer. Lastly, in many cases evaluation is very non-trivial. For example, how do you automatically evaluate if a robot has succeeded in making an omelette? (6 is violated).
  • There is rarely a human data source with millions of demonstrations (so 7 is violated).

In short, basically every single assumption that Go satisfies and that AlphaGo takes advantage of are violated, and any successful approach would look extremely different. More generally, some of Go’s properties above are not insurmountable with current algorithms (e.g. 1,2,3), some are somewhat problematic (5,7), but some are quite critical to how AlphaGo is trained but are rarely present in other real-world applications (4,6).

In conclusion

While AlphaGo does not introduce fundamental breakthroughs in AI algorithmically, and while it is still an example of narrow AI, AlphaGo does symbolize Alphabet’s AI power: in both the quantity/quality of the talent present in the company, the computational resources at their disposal, and the all in focus on AI from the very top.

Alphabet is making a large bet on AI, and it is a safe one. But I’m biased 🙂

EDIT: the goal of this post is, as someone on reddit mentioned, “quelling the ever resilient beliefs of the public that AGI is right down the road”, and the target audience are people outside of AI who were watching AlphaGo and would like a more technical commentary.

Google creates AI studio to act as an incubator-like program

About the program

Image icon of a half brain, half a.i. blend.We focus on applying tech to product. Thanks in great part to the open-source movement, it’s easier than ever to build a technology company. However, AI & ML innovation is still in its nascent phase and very hard to apply in the building of comprehensive solutions and scalable products.

We want to make technology accessible. In line with recent announcements made by Google’s CEO Sundar Pichai and Chief Scientist Fei Fei Li, Launchpad is more committed than ever to make new technological advances, like AI and ML, universally accessible and useful to startups globally.

We offer tools and best practices to apply AI to products. With this in mind, Launchpad Studio aims to be a go-to hub for the world’s best AI entrepreneurs by empowering them on their journeys, as they build next-gen products that matter.”

https://developers.google.com/startups/studio/

Senior Data Scientist

We’re an exciting young startup that is growing incredibly fast and making a huge impact in the world of digital advertising.
Our platform is connected to thousands of publishers and advertisers worldwide, dealing with hundreds of thousands of requests each second. We utilize the latest technology to solve challenges in traffic, data storage, machine learning, and scalability.
We are searching for a talented data scientist to join our fun and hard-working team, as we go all-in on our data science efforts. This is an important role in one of Toronto’s hottest startups with unlimited potential for growth and opportunities.
Responsibilities:
  • Develop models and algorithms to maximize ROI for platform campaigns and bidding strategies
  • Develop strategies to effectively filter and categorize inventory and impressions
  • Implement a data analysis framework, consisting of tools to analyze and test models effectively
  • Generate insights on user behaviour and implement necessary solutions
    Be able to test results and optimize efficiently
Requirements
  • At least 2 years of relevant experience as a Data Scientist, Masters/PhD degree preferred.
  • Proficient software programming skills, proficiency with Python (Scikit Learn), R (ggplot), and/or Scale
  • Strong understanding Bayesian methods, multidimensional data analysis (PCA, LDA) preferred·
  • Strong experience with multivariate regression (logistic, linear), and classification (random forest, decision tree) preferred
  • Strong experience of machine learning theory (i.e. adaboost, SVM, neural networks)
  • Understanding of applied stochastic processes (Preferred)
  • Pipeline development in working with Hadoop, Spark, Hive, Hbase and related big data technologies (Preferred)
  • Background in advertising technology is a plus
Compensation & Perks:
  • Competitive salary, Full benefits, Gym Membership Reimbursement, weekly yoga, office sport leagues & more
  • Free healthy lunches on Mondays, lots of snacks, weekly beer Fridays, opportunity to become great at Ping Pong
  • Bright office in the heart of the Spadina startup hub
  • Quarterly team events- escape games, bubble soccer, obstacle courses, and much more!

 

 

Apply

Toronto AI Workshop – Convolutional Neural Networks

Toronto AI – Convolutional Neural Networks
Thursday, August 10, 2017
6:15 PM to 8:30 PM
Naborly
302-207 Adelaide Street East, Toronto, ON

Join us for a fascinating evening where we dive into convolutional neural networks.

We will explore some of the concepts and applications behind this powerful form of machine learning, followed by a code demo on how these neural nets can be implemented in TensorFlow. Plenty of social time is planned.

Our friends at Naborly are sponsoring us with their uniquely brilliant space downtown for this event so it will be a very cool night with them. Stay tuned for more details!

Side note: we are starting to collaborate with the Toronto Women’s Data Group – they are hosting some really great events specifically for the community of women (i.e. band of data ninjas) in data science, so be sure to check them out!

 

https://www.meetup.com/Toronto-AI/events/241804628/

AI workshop – TensorFlow intro

We’re hosting a intro-level AI workshop at the Toronto City Hall on June 28th –  that explores machine learning with Python and the open source library TensorFlow.  TensorFlow is the second generation machine learning system behind Google Brain (https://research.google.com/teams/brain/).

There will be a presentation and during that time we’ll walk through the code and use visualisations that allow us to actually see how its internal representation morphs over time as it learns.  We’ll also try out some live AI experiments to get an intuitive feel for how the model behaves.

Wednesday, June 28, 2017

to

Toronto City Hall, Committee Room #1

100 Queen Street West, Toronto, ON

 

Cost function:  Free

Pre-requisites:

Please bring a laptop with with Docker CE installed:

https://www.docker.com/community-edition

Stay tuned for further instructions!

Please note:  This is the third replay (iteration) of this workshop, covering the same content as the past two workshops.  Please be patient, we are working on a new workshop for later this summer, and we’ll post a social night in the near future.

 

https://www.meetup.com/Toronto-AI/events/240567493/

ICML accepted papers institution stats

The accepted papers at ICML have been published. ICML is a top Machine Learning conference, and one of the most relevant to Deep Learning, although NIPS has a longer DL tradition and ICLR, being more focused, has a much higher DL density.

Most mentioned institutions

I thought it would be fun to compute some stats on institutions. Armed with Jupyter Notebook and regex, we look for all of the institution mentions, add up their counts and sort. Modulo a few annoyances:

  • I manually collapse e.g. “Google”, “Google Inc.”, “Google Brain”, “Google Research” into one category, or “Stanford” and “Stanford University”.
  • I only count up one unique mention of an institution on each paper, so if a paper has 20 people from a single institution this gets collapsed to a single mention. This way we get a better understanding of which institutions are involved on each paper in the conference.

In total we get 961 institution mentions, 420 unique. The top 30 are:

#mentions institution
---------------------
44 Google
33 Microsoft
32 CMU
25 DeepMind
23 MIT
22 Berkeley
22 Stanford
16 Cambridge
16 Princeton
15 None
14 Georgia Tech
13 Oxford
11 UT Austin
10 Duke
10 Facebook
9 ETH Zurich
9 EPFL
8 Columbia
8 Harvard
8 Michigan
7 UCSD
7 IBM
7 New York
7 Peking
6 Cornell
6 Washington
6 Minnesota
5 Virginia
5 Weizmann Institute of Science
5 Microsoft / Princeton / IAS

I’m not quite sure about “None” (15) in there. It’s listed as an institution on the ICML page and I can’t tell if they have a bug or if that’s a real cool new AI institution we don’t yet know about.

Industry vs. Academia

To get an idea of how much of the research is done at industry, I took the counts for the largest industry labs (DeepMind, Google, Microsoft, Facebook, IBM, Disney, Amazon, Adobe) and divide by the total. We get 14%, but this doesn’t capture the looong tail. Looking through the tail, I think it’s fair to say that

about 20–25% of papers have an industry involvement.

or rather, approximately three quarters of all papers at ICML have come entirely out of Academia. Also, since DeepMind/Google are both Alphabet, we can put them together (giving 60 total), and see that

6.3% of ICML papers have a Google/DeepMind author.

It would be fun to run this analysis over time. Back when I started my PhD (~2011), industry research was not as prevalent. It was common to see in Graphics (e.g. Adobe / Disney / etc), but not as much in AI / Machine Learning. A lot of that has changed and from purely subjective observation, the industry involvement has increased dramatically. However, Academia is still doing really well and contributes a large fraction (~75%) of the papers.

cool!

EDIT 1: fixed an error where previously the Alphabet stat above read 10% because I incorrectly added the numbers of DM and Google, instead of properly collapsing them to a single Alphabet entity.
EDIT 2: some more discussion and numbers on r/ML thread too.

AI workshop – TensorFlow intro

Wednesday, May 31, 2017
Door access from 6:10 to 6:30pm

We introduce and explore the basics of TensorFlow (https://www.tensorflow.org/), the second generation machine learning system behind Google Brain (https://research.google.com/teams/brain/), in a presentation+workshop setting, where we’ll walk through a simple machine learning code example together with visualizations that allows us to see what is happening in real time during the training

То access the building, please arrive between 6:10 and 6:30. Huge thank you to Ryan at Workhaus (http://workhaus.bz) for sponsoring us with the space!

At 8:00 if there is space, we’ll then head out for drinks just outside, at either Jason George (http://www.thejasongeorge.ca/) or the patio at the Corner Place (http://www.thecornerplace.ca/).

Looking forward to seeing you there!

Note: For those who attended the previous meetup: this is a replay of that event with the same workshop, providing the chance to those who were waitlisted last time to attend and anyone who is interested

Pre-requisites

– A laptop with Anaconda installed (download here (https://www.continuum.io/downloads)). Once installed, create a Python 3.5 (i.e. not 3.6) environment within Ananconda Navigator.

PLEASE REGISTER AT
https://www.meetup.com/Toronto-AI/events/240122033/