Giter Site home page Giter Site logo

robot-pattern-gen's Introduction

robot-pattern_gen

This is a repository for studying generative pattern models for the robot.

Now, we implemented a score-conditioned generative model (by leveraging conditional VAE) and proxy score function.

Training proxy and generator

First, we train proxy score function $f_{\phi}(x) \approx f(x)$ using offline data $D_{\text{off}} = (x_i,f(x_i))_{i=1}^{N}$, where $x_i$ is pattern data (represented as image tensor) and $f(x_i)$ stands for score from robot simulation function $f$.

Second, we train conditional VAE to attain score conditioned generator which satisfies $p(x|y,z) \propto 1_{f(x)=y}$ and $z \sim \mathcal{N}(0,1)$ using offline data $D_{\text{off}}$.

Samples pattern from trained generator and proxy

First, we samples $M$ candidates of patterns $X_{\text{candidates}}$ as: $x \sim p(x|y^{\text{max}},z)$ where $z \sim \mathcal{N}(0,1)$. Note $y^{\text{max}}$ is some high value we desire to get.

Note that $X_{\text{candidates}}$ stands for the set of sampled $x$ where $|X_{\text{candidates}}| = M$.

Second, we screen the $M$ candidates as TopK patterns based on the score evaluated by the proxy function $f_{\phi}$: $X_{\text{final}}:= \text{TopK}(f_{\phi}, X_{\text{candidates}})$. Specifically, for each sample $x \in X_{\text{candidates}}$, (1) we assign pseudo-score using $f_{\phi}(x)$, (2) sort it based on the suede-score and (3) collect Top K samples among them.

Dependancies

  • Python>=3.8
  • NumPy
  • SciPy
  • PyTorch>=1.1
  • tqdm
  • Matplotlib

How to run?

python train.py

robot-pattern-gen's People

Contributors

alstn12088 avatar seonggukkim avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.