Skip to content

Instantly share code, notes, and snippets.

View ppwwyyxx's full-sized avatar
🎯
Focusing

Yuxin Wu ppwwyyxx

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: CycleGAN-replaybuffer.py
import os, sys
import argparse
import glob
from six.moves import map, zip, range
from collections import deque
import numpy as np
@ppwwyyxx
ppwwyyxx / f1.diff
Last active June 23, 2017 00:03
Patch f1 (https://github.com/ebonyclock/vizdoom_cig2017) to work under latest TensorFlow + latest tensorpack
diff --git i/f1/F1_track1/agent.py w/f1/F1_track1/agent.py
index a717842..4ae8405 100644
--- i/f1/F1_track1/agent.py
+++ w/f1/F1_track1/agent.py
@@ -140,15 +140,15 @@ class FinalEnv(RLEnvironment):
class Model(ModelDesc):
- def _get_input_vars(self):
- return [InputVar(tf.float32, (None,) + IMAGE_SHAPE3, 'image'),
@ppwwyyxx
ppwwyyxx / tensorpack-gym.md
Last active May 23, 2018 09:29
placeholder for OpenAI Gym submission

Use A3C (asynchronous advantage actor-critic) written in TensorFlow. Training code, model & evaluation code at this repo

Gist doesn't have notifications, please use repo issues to discuss.

### Keybase proof
I hereby claim:
* I am ppwwyyxx on github.
* I am ppwwyyxx (https://keybase.io/ppwwyyxx) on keybase.
* I have a public key whose fingerprint is AEA1 11B6 420F 3D2A DE8B 6919 6FC3 FF92 B88D D8A0
To claim this, I am signing this object:
set scalehints
set noautofocus
set showtabindices
"set defaultnewtabpage
let mapleader = ","
let highlight = '#d28ce3'
let activehighlight = '#0ff3db'
let qmark g = ["http://google.com"]
let blacklists = ["*://mail.google.com/*"]
map gm :tabnew mail.google.com&<CR>
@ppwwyyxx
ppwwyyxx / smallpt.cc
Last active August 7, 2016 17:41
A cleaner version of smallpt
#include <math.h> // smallpt, a Path Tracer by Kevin Beason, 2008
#include <stdlib.h> // Make : g++ -O3 -fopenmp smallpt.cpp -o smallpt
#include <stdio.h> // Remove "-fopenmp" for g++ version < 4.2
struct Vec { // Usage: time ./smallpt 5000 && xv image.ppm
double x, y, z; // position, also color (r,g,b)
Vec(double x_ = 0, double y_ = 0, double z_ = 0) {
x = x_;
y = y_;
z = z_;
}
@ppwwyyxx
ppwwyyxx / reverse_iterator.cpp
Last active April 20, 2020 21:32
C++11 Reverse Iterator Used in Ranged For Loop
//File: reverse_iterator.cpp
//Date: Thu Jul 17 09:54:05 2014 -0700
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <cstdio>
#include <limits>
using namespace std;