Skip to content

Instantly share code, notes, and snippets.

View ktl014's full-sized avatar

Kevin Tran Vu Le ktl014

  • University of California, San Diego
  • La Jolla, CA
View GitHub Profile
@ktl014
ktl014 / 0_reuse_code.js
Created April 26, 2017 04:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# ================== Loading & Exploring JSON ================== #
# Load JSON: json_data
with open("a_movie.json") as json_file:
json_data = json.load(json_file)
# Print each key-value pair in json_data
for k in json_data.keys():
print(k + ': ', json_data[k])
# ================== Query API & decode JSON data ================== #
input: "image"
input_dim: 1
input_dim: 3
input_dim: 1 # This value will be defined at runtime
input_dim: 1 # This value will be defined at runtime
layer {
name: "conv1_1"
type: "Convolution"
bottom: "image"
top: "conv1_1"
>>> class Library(object):
... def __init__(self):
... self.books = { 'title' : object, 'title2' : object, 'title3' : object, }
... def __getitem__(self, i):
... return self.books[i]
... def __iter__(self):
... return self.books.itervalues()
...
>>> library = Library()
>>> library['title']
name: "VGG_ILSVRC_19_layers"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 224
input_dim: 224
layers {
bottom: "data"
top: "conv1_1"
name: "conv1_1"
name: "VGG_ILSVRC_16_layers"
layer {
name: "data"
type: "Data"
include {
phase: TRAIN
}
transform_param {
crop_size: 224
mean_value: 104
@ktl014
ktl014 / train_val_exp2.prototxt
Last active May 30, 2018 03:06
CaffeNet model
name: "AlexNet"
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
# transform_param {
name: "ResNet-50"
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
@ktl014
ktl014 / urllib.py
Created May 25, 2018 19:11
how to open urls with urllib
from urllib.request import urlopen
html = urlopen("http://www.google.com/")
print(html)
#! /usr/bin/env python
from __future__ import absolute_import, division, print_function
import os
import matplotlib.pyplot as plt
import tensorflow as tf
import keras
import tensorflow.contrib.eager as tfe