techlist.io

Soft Attention

2 posts

OpenAI2017-05-152 min readCurated summary

Robots that learn

# Training Robots in Simulation to Learn Tasks from a Single Demonstration OpenAI describes a robotics system trained entirely in simulation that can learn a new task after watching one human demonstration, then reproduce that task on a physical robot from a different starting configuration. The approach combines domain randomization for vision with a one-shot imitation learning network, so the robot never needs real-world training images or real demonstrations for its core learning. ## Domain Randomization for Vision - The vision network takes a camera image and outputs a state representation of object positions. - It is trained on hundreds of thousands of simulated images with randomized lighting, textures, backgrounds, and object appearance. - It never sees a real image during training, yet transfers to the physical robot. ## One-Shot Imitation Learning - A human demonstrates the task in VR, and the imitation network infers the task's intent from that single demonstration. - The network then performs the same task from a new starting configuration, so it must generalize rather than replay the exact motions. - Training uses dozens of tasks with thousands of demonstrations each. Each example is a pair of demonstrations of the same task: the network sees the full first demonstration plus one observation from the second, and uses supervised learning to predict the action taken at that observation. - To predict actions well, the network must learn which parts of the first demonstration matter for the task. ## Block Stacking Experiment - The task of stacking color-coded blocks into towers was simple enough to solve with a scripted policy in simulation, which generated the imitation network's training data. - Training pairs started from different initial states but produced towers in the same order, so the network learned to match the demonstrator's block ordering and tower sizes without depending on the towers' relative locations. - Despite never seeing messy human data during training, the network parsed real human demonstrations at test time. - Soft attention over the demonstration trajectory lets the system handle demonstrations of variable length. - Attention over individual block locations lets it imitate longer sequences than it saw in training and build towers with more blocks than any training demonstration. - Injecting modest noise into the scripted policy's outputs was necessary. It forced the demonstrations to include recovery from mistakes, and without it the imitation network usually failed to complete the stacking task.

OpenAI2017-03-202 min readCurated summary

One-shot imitation learning

Researchers propose one-shot imitation learning, a meta-learning approach that lets a robot learn a task from a single demonstration and then perform new instances of that task. Current imitation learning typically needs careful feature engineering or many samples for each task, which is far from the goal of robots that generalize instantly from very little data. The authors argue that training on a broad enough range of tasks could eventually produce a general system that turns any demonstration into a working policy. ## Problem Setting - Existing imitation learning usually solves each task in isolation. - It depends on hand-crafted features or large numbers of demonstrations. - The goal is a robot that learns from very few demonstrations and adapts to new situations of the same task without task-specific engineering. ## Task Structure and Training Data - The authors consider a large set of tasks, where each task has many instances that differ in initial states. - Example tasks include stacking all blocks on a table into one tower, or arranging them into two-block towers. - At training time, the model sees pairs of demonstrations for a subset of tasks. ## Model and Training Objective - A neural network takes as input one demonstration and the current state, which starts as the initial state of the paired demonstration. - It outputs an action, and the goal is for the resulting sequence of states and actions to match the second demonstration as closely as possible. - The model uses soft attention, which the authors credit with generalizing to conditions and tasks not seen during training. ## Test-Time Behavior - At test time, the model receives one demonstration of a single instance of a new task. - It is then expected to perform well on other instances of that same task. ## Outlook - The authors expect that training on a much wider variety of tasks and settings could yield a general system that converts any demonstration into a robust policy for a broad range of tasks.