Skip to content

Instantly share code, notes, and snippets.

View vincentchu's full-sized avatar

Vincent Chu vincentchu

View GitHub Profile
This file has been truncated, but you can view the full file.
pragma solidity ^0.4.19;
import './ERC721.sol';
contract CryptoMarchMadness is ERC721, ERC721Metadata, ERC721Enumerable {
uint256 private constant MASK = 0x3f;
uint256 public basePoolFeeInWei; // Fee required to purchase a bracket
uint256 public collectorFeeInWei; // Flat fee reserved for the pool operator
#!/usr/bin/python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import tensorflow as tf
import numpy as np
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**
* Anchors
*
* SSD Anchor boxes for SSD/Mobilenet architectures
* num_layers = 6
* min_scale = 0.2
* max_scale = 0.95
* aspect_ratios = [1.0, 2.0, 0.5, 3.0, 0.3333]
*
* See: https://github.com/tensorflow/models/blob/master/research/object_detection/anchor_generators/multiple_grid_anchor_generator.py#L248

Keybase proof

I hereby claim:

  • I am vincentchu on github.
  • I am vincentchu (https://keybase.io/vincentchu) on keybase.
  • I have a public key whose fingerprint is 65A8 1914 DA36 AD76 3064 FFCC FF65 8271 A604 2569

To claim this, I am signing this object:

@vincentchu
vincentchu / PasswordHashRecovery.sol
Last active September 20, 2017 06:05
Solidity smart contract for cracking passwords
pragma solidity ^0.4.15;
import { SHA1 } from './SHA1.sol';
contract PasswordHashRecovery is SHA1 {
event PasswordCracked(address crackedBy, uint256 bounty, string password, bytes hash);
event AttemptFailed(address source, string password, bytes hash);
address public owner;
uint256 public bounty;
export DATASET_DIR=/tmp/data/flowers
export TRAIN_DIR=/tmp/data/tfrun
export CHECKPOINT_PATH=/tmp/data/checkpoints
mkdir -p $DATASET_DIR $TRAIN_DIR $CHECKPOINT_PATH
CWD=`pwd`
cd $CHECKPOINT_PATH && wget http://download.tensorflow.org/models/inception_v4_2016_09_09.tar.gz && tar -xvzf inception_v4_2016_09_09.tar.gz
cd $CWD
@vincentchu
vincentchu / build_tf.sh
Last active January 3, 2018 22:40
Building Tensorflow + CUDA + cuDNN
# Build Tensorflow + CUDA on ubuntu 16.04
#
# Modified from:
# - http://expressionflow.com/2016/10/09/installing-tensorflow-on-an-aws-ec2-p2-gpu-instance/
# - https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel-gpu
# - https://github.com/NVIDIA/nvidia-docker/blob/master/ubuntu-16.04/cuda/8.0/devel/cudnn5/Dockerfile
# - https://github.com/NVIDIA/nvidia-docker/blob/master/ubuntu-16.04/cuda/8.0/devel/Dockerfile
# - https://github.com/NVIDIA/nvidia-docker/blob/master/ubuntu-16.04/cuda/8.0/runtime/Dockerfile
# Install base packages
@vincentchu
vincentchu / gist:ba38ad44027fc98afaf0f03ea2fb55c2
Created January 20, 2017 01:53
Tensorflow w/ and w/o GPU
# With GPU
Batch: 0 - elapsed: 0.37758 sec
Batch: 100 - elapsed: 0.01429 sec
Batch: 200 - elapsed: 0.01433 sec
Batch: 300 - elapsed: 0.01449 sec
Batch: 400 - elapsed: 0.01442 sec
Batch: 500 - elapsed: 0.01444 sec
Batch: 600 - elapsed: 0.01459 sec
Batch: 700 - elapsed: 0.01465 sec
Batch: 800 - elapsed: 0.01462 sec