Skip to content

Instantly share code, notes, and snippets.

View ronghanghu's full-sized avatar

Ronghang Hu ronghanghu

View GitHub Profile
@ronghanghu
ronghanghu / multigpu_mnist_train_log.txt
Last active August 29, 2015 14:27
Multi-GPU Training Logs
I0812 15:00:42.248405 8934 caffe.cpp:160] Using GPUs 0, 1, 2
I0812 15:00:42.422600 8934 solver.cpp:38] Initializing solver from parameters:
test_iter: 100
test_interval: 500
base_lr: 0.01
display: 100
max_iter: 10000
lr_policy: "inv"
gamma: 0.0001
power: 0.75
@ronghanghu
ronghanghu / mexopt.sh
Created November 19, 2015 17:27
Matlab mex setting
#
# mexopts.sh Shell script for configuring MEX-file creation script,
# mex. These options were tested with the specified compiler.
#
# usage: Do not call this file directly; it is sourced by the
# mex shell script. Modify only if you don't like the
# defaults after running mex. No spaces are allowed
# around the '=' in the variable assignment.
#
# Note: For the version of system compiler supported with this release,
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally
WARNING:tensorflow:<tensorflow.python.ops.rnn_cell.BasicLSTMCell object at 0x7fe3fc03dd10>: Using a concatenated state is slower and will soon be deprecated. Use state_is_tuple=True.
I tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 0 with properties:
name: Tesla K40c
major: 3 minor: 5 memoryClockRate (GHz) 0.745
pciBusID 0000:88:00.0
#!/usr/bin/env python2
import json
import sys
with open(sys.argv[1]) as data_file, \
open("ids.txt", "w") as id_file, \
open("questions.txt", "w") as question_file:
data = json.load(data_file)
questions = data["questions"]
@ronghanghu
ronghanghu / laser_test.py
Created August 14, 2017 16:53
ImageNET 22k Laser test
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import logging
import os
import cv2
from laser.client.py import LaserClient, Options
@ronghanghu
ronghanghu / visualize_vqa.ipynb
Created August 15, 2017 16:19
Visualize VQA attentions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ronghanghu
ronghanghu / train_clevr.py
Last active May 1, 2018 02:46
CLEVR train
import tensorflow as tf
from glob import glob
import numpy as np
sess = tf.Session(config=tf.ConfigProto(
gpu_options=tf.GPUOptions(allow_growth=True)))
N = 100 # batch_size
@ronghanghu
ronghanghu / trajectory_visualization_v2.ipynb
Last active November 1, 2024 16:10
Speaker-Follower visualization
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import matplotlib.pyplot as plt
import os.path as osp
import numpy as np
angle_inc = np.pi / 6.
def print_bbox(bbox):
x1, y1, x2, y2 = bbox
plt.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], 'r-')
@ronghanghu
ronghanghu / The Technical Interview Cheat Sheet.md
Created April 19, 2019 22:44 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.