Neural Program Synthesis from Diverse Demonstration Videos · Demo 1 Demo 2 Demo 3 Program...

1
Neural Program Synthesis from Diverse Demonstration Videos Shao-Hua Sun *1 , Hyeonwoo Noh *2 , Sriram Somasundaram 1 , Joseph Lim 1 [email protected] [email protected] [email protected] [email protected] 1 2 Contribution def run(): turnRight() turnRight() while frontIsClear(): move() if markersPresent(): turnLeft() move() else: turnRight() Underlying program Diverse Demonstrations: Executions with different initial states Objective: Inferring underling program from demonstrations Demo 1 Demo 2 Demo 3 Program synthesis for explicit modeling of underlying programs Architecture for summarizing diverse demonstrations Auxiliary objectives enhancing program synthesis Our approach: Neural Program Synthesis Q: Could we infer underlying program of a behavior from diverse demonstration videos? Neural Program Synthesizer DEF run { turnRight turnRight WHILE ( fronIsClear ) {.. Demonstration videos Program as a token sequence Experimental Setting Induction baseline (Few-shot imitation) Synthesis baseline Implicit modeling of programs by learning to imitate Induction baseline move turnRight move move turnLeft putMarker ... Demonstration videos Take actions Implicit model of program New initial state Environment Program synthesis without summarizer / multi-task loss Karel: ○ Movement Put / pick marker ViZDoom: ○ Movement Kill monster Select weapon Experimental Results ● Karel Proposed Model Overall architecture Summarizer module Summarizer module: ○ Inferring actions and underlying conditions from demonstrations Multi-task loss: ○ Learning representation for inferring action / perception from demonstrations Problem Statement ● ViZDoom Advantage of explicit modeling of program Effect of summarizer / multi-task loss Effect of summarizer with more demonstrations Advantage of summarizer is bigger with more demonstrations If-else experiment - inferring condition Single IFELSE statement with 1 condition, 2 different actions Inferring correct condition is essential Generalization to more / less demonstrations Training with 25 demos, generalization to more / less demos Qualitative Results Underlying program def run(): if inTarget HellKnight: attack() if not inTarget Demon: moveRight() : attack() def run(): if inTarget HellKnight: attack() if inTarget Demon: attack() else: moveRight() Synthesized program inTarget HellKnight inTarget HellKnight attack() not inTarget Demon moveRight() inTarget HellKnight and inTarget Demon inTarget HellKnight attack() inTarget Demon attack() Demo 1 Demo 2 https://shaohua0116.github.io/demo2program/ Underlying program def run(): if frontIsClear(): move() else: turnLeft() move() turnLeft() repeat(2): turnRight() putMarker() Karel ViZDoom def run(): if frontIsClear(): move() else: turnLeft() move() turnLeft() turnRight() putMarker() turnRight() putMarker() def run(): move() move() turnLeft() turnRight() putMarker() turnRight() putMarker() ● Ours-full ● Baseline

Transcript of Neural Program Synthesis from Diverse Demonstration Videos · Demo 1 Demo 2 Demo 3 Program...

Page 1: Neural Program Synthesis from Diverse Demonstration Videos · Demo 1 Demo 2 Demo 3 Program synthesis for explicit modeling of underlying programs Architecture for summarizing diverse

Neural Program Synthesis from Diverse Demonstration VideosShao-Hua Sun*1, Hyeonwoo Noh*2, Sriram Somasundaram1, Joseph Lim1

[email protected] [email protected] [email protected] [email protected]

1 2

❏ Contribution

def run(): turnRight() turnRight() while frontIsClear():

move() if markersPresent():

turnLeft() move()

else: turnRight()

Underlying programDiverse Demonstrations:Executions with different initial states

Objective: Inferring underling program from demonstrations

Demo 1 Demo 2 Demo 3

● Program synthesis for explicit modeling of underlying programs● Architecture for summarizing diverse demonstrations● Auxiliary objectives enhancing program synthesis

❏ Our approach: Neural Program Synthesis

Q: Could we infer underlying program of a behavior from diverse demonstration videos?

Neural Program Synthesizer

DEF run { turnRight turnRight WHILE ( fronIsClear ) {..

Demonstration videos Program as a token sequence

Experimental Setting

❏ Induction baseline (Few-shot imitation)

❏ Synthesis baseline

● Implicit modeling of programs by learning to imitate

Induction baseline move turnRight move move turnLeft putMarker ...

Demonstration videosTake actions

Implicit model of program New initial stateEnvironment

● Program synthesis without summarizer / multi-task loss

● Karel:○ Movement○ Put / pick

marker

● ViZDoom:○ Movement○ Kill monster○ Select weapon

Experimental Results

● Karel

Proposed Model❏ Overall architecture

❏ Summarizer module

● Summarizer module:○ Inferring actions and underlying

conditions from demonstrations● Multi-task loss:

○ Learning representation for inferring action / perception from demonstrations

Problem Statement

● ViZDoom

❏ Advantage of explicit modeling of program ❏ Effect of summarizer / multi-task loss

❏ Effect of summarizer with more demonstrations● Advantage of summarizer is bigger with more demonstrations

❏ If-else experiment - inferring condition● Single IFELSE statement with 1 condition, 2 different actions● Inferring correct condition is essential

❏ Generalization to more / less demonstrations● Training with 25 demos, generalization to more / less demos

Qualitative Results

● Underlying programdef run(): if inTarget HellKnight: attack() if not inTarget Demon: moveRight() else: attack()

def run(): if inTarget HellKnight: attack() if inTarget Demon: attack() else: moveRight()

● Synthesized program

inTarget HellKnight

inTarget HellKnight➝ attack()

not inTarget Demon➝ moveRight()

inTarget HellKnight and inTarget Demon

inTarget HellKnight➝ attack()

inTarget Demon➝ attack()

Demo 1 Demo 2

https://shaohua0116.github.io/demo2program/

● Underlying programdef run(): if frontIsClear(): move() else: turnLeft() move() turnLeft() repeat(2): turnRight() putMarker()

❏ Karel ❏ ViZDoom

def run(): if frontIsClear(): move() else: turnLeft() move() turnLeft() turnRight() putMarker() turnRight() putMarker()

def run(): move() move() turnLeft() turnRight() putMarker() turnRight() putMarker()

● Ours-full ● Baseline