Skip to content

Instantly share code, notes, and snippets.

View daerduoCarey's full-sized avatar

Kaichun Mo daerduoCarey

View GitHub Profile
import numpy as np
import os
import h5py
import json
from subprocess import call
import progressbar
from collections import deque
import time
import random
from colors import colors
# install trimesh: pip install trimesh
import trimesh
# I assume you know numpy
import numpy as np
# this func helps export the point cloud as a ply file
def export_ply(out, v):
with open(out, 'w') as fout:
fout.write('ply\n');
import os
import sys
import h5py
import numpy as np
from progressbar import ProgressBar
from commons import check_mkdir
def load_gt_h5(fn):
""" Output: pts B x N x 3 float32
gt_mask B x K x N bool
@daerduoCarey
daerduoCarey / binvox_rw.py
Created November 13, 2017 23:30 — forked from chrischoy/binvox_rw.py
ShapeNet Voxelization
# Copyright (C) 2012 Daniel Maturana
# This file is part of binvox-rw-py.
#
# binvox-rw-py is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# binvox-rw-py is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@daerduoCarey
daerduoCarey / binvox_rw.py
Created November 13, 2017 23:30 — forked from chrischoy/binvox_rw.py
ShapeNet Voxelization
# Copyright (C) 2012 Daniel Maturana
# This file is part of binvox-rw-py.
#
# binvox-rw-py is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# binvox-rw-py is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@daerduoCarey
daerduoCarey / run_parallel.py
Created August 20, 2017 22:49
run_parallel.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
MOVED FROM /orions4-zfs/projects/rqi/Code/3dcnn/lfd/run_parallel.py
PLEASE CHECK ORIGINAL FILE FOR UPDATES!
'''
import os
import sys
import datetime
# These lists are later turned into target properties on main caffe library target
set(Caffe_LINKER_LIBS "")
set(Caffe_INCLUDE_DIRS "")
set(Caffe_DEFINITIONS "")
set(Caffe_COMPILE_OPTIONS "")
# ---[ Boost
set(BOOST_ROOT /data/kaichun/local)
find_package(Boost 1.61 REQUIRED COMPONENTS system thread filesystem serialization program_options)
list(APPEND Caffe_INCLUDE_DIRS PUBLIC ${Boost_INCLUDE_DIRS})
import json
import os
import re
import urlparse
import uuid
import urllib2
import time
from http import download_safe
import os
import sys
import numpy as np
from data_util import *
import datetime
ply_filelist = 'scripts/modelnet40_ply_filelist_shuffled.txt'
H5_BATCH_SIZE = 2000

NIPS Notes

Tutorials

Variational Inference

  • Simple Intro by Blei mostly going over review paper of Jordan
  • Later introduce SVI (Stochastic VI) as a remedy to solve VI tractably with large dataset.
  • Review the black box inference -assumption free VI- http://www.jmlr.org/proceedings/papers/v33/ranganath14.pdf
  • Key idea is replacing gradient and the expectation in VI formulation. Since expectation reqiuires exponential family assumption to work replacing expectation and gradient solves this if overall method is stochastic since your samples are unbiased gradient estimates satisfying Robinson-Monroe conditions however the variance is very large and it requires even further tricks