Skip to content

Instantly share code, notes, and snippets.

Yen-Chen Lin yenchenlin

Block or report user

Report or block yenchenlin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View A
# Check if something is in between gripper fingers by measuring grasp width
# def check_grasp_robotiq(self):
# self._gripper_data = None
# tcp_msg = 'def process():\n'
# tcp_msg += ' socket_open("",63352,"gripper_socket")\n'
# tcp_msg += ' rq_pos = socket_get_var("POS","gripper_socket")\n'
# tcp_msg += ' sync()\n'
# tcp_msg += ' textmsg("value = ",rq_pos)\n'
# tcp_msg += ' socket_open("",50201,"desktop_socket")\n'
# tcp_msg += ' socket_send_int(rq_pos,"desktop_socket")\n'
yenchenlin /
Created Oct 25, 2019
Figure tips from Prof. Isola

Figure tips

General advice

  • Spend as much time on figures as you do on writing
  • Use perceptual grouping to your advantage
  • Never use default graphical styles; develop your own brand
  • Minimize the data-ink ratio
  • The figure should be understandable without reading the caption

Perceptual grouping

yenchenlin /
Last active Oct 25, 2019
Writing tips from Prof. Isola

Writing tips

The golden rule: do the most, with the least

General advice

11 rules

(1-4 and 11 adapted from George Orwell's six rules)

  • Rule 1: Never use a metaphor, simile, or other figure of speech that you are used to seeing in print
  • Rule 2: Never use jargon if you can think of an everyday English equivalent
yenchenlin /
Created Jun 25, 2019
How to run Yen-Chen's code?


First, make sure we have the right environment. Comment out the conda command in ~/.bashrc and run

source ~/.bashrc
conda activate corl

After that, comment out the conda command and open a new tab will get back to python 2.7 environment.

import tensorflow as tf
import numpy
from sklearn.datasets import fetch_mldata
FLAGS ='seed', 1, "initial random seed")'layer_sizes', '784-1200-600-300-150-10', "layer sizes")
View main.lua
require 'torch'
require 'nn'
require 'optim'
-- to specify these at runtime, you can do, e.g.:
-- $ lr=0.001 th main.lua
opt = {
dataset = 'video2', -- indicates what dataset load to use (in data.lua)
nThreads = 32, -- how many threads to pre-fetch data
batchSize = 64, -- self-explanatory

I've tried to make SequentialDataset support Cython fused types, but it seems really expensive. You can find the modified code in this branch.

tl;dr - seq_dataset.pyx is heavily bound with sag_fast.pyx, sgd_fast.pyx.

After I modified seq_dataset.pyx, this line in sag_fast.pyx requires to change as well since this pointer is passed into SequentialDataset's function. However, my past experience is that one can only declare local floating variable when at least one of the function's argument variable also belongs to floating type. Nonetheless, that's not the case here, unless we make this function's arguments

np.ndarray[double, ndim=2, mode='c'] weights_array
np.ndarray[double, ndim=1, mode='c'] intercept_array
yenchenlin /
Created Jul 12, 2016 — forked from titipata/
My notes on how to install caffe on Ubuntu

Caffe Installation

Note on how to install caffe on Ubuntu. Sucessfully install using CPU, more information for GPU see this link


  • verify all the preinstallation according to CUDA guide e.g.
lspci | grep -i nvidia
You can’t perform that action at this time.