Skip to content

Instantly share code, notes, and snippets.

View spencerzhang91's full-sized avatar
🎯
Focusing

Spencer Zhang spencerzhang91

🎯
Focusing
  • The Hong Kong Polytechnic University
  • Hong Kong
View GitHub Profile
@spencerzhang91
spencerzhang91 / win-ss
Created September 14, 2020 13:44 — forked from dreamlu/win-ss
windows终端翻墙,简易方式
环境:shadowsocks、windows
本地ss端口设置(这里1080)
cmd命令行:(不用socks5)(临时设置)(也可放置环境变量)
set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080
ps:一定要用cmd命令行,千万别用powershell !!!
简易测试命令:curl https://www.google.com(别用ping)
@spencerzhang91
spencerzhang91 / btree.py
Created September 12, 2019 03:15
Leetcode way of constructing a binary tree
# Leetcode way of constructing a binary tree
from collections import deque
class Node:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
@spencerzhang91
spencerzhang91 / datapipe.py
Created March 22, 2019 15:04
datapipe.py
'''
Copyright (c) <2018> <Pingcheng Zhang>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@spencerzhang91
spencerzhang91 / char_rnn.py
Last active April 29, 2020 08:25
How to use PyTorch DataParallel to train LSTM on charcters.
'''
Character-Level LSTM in PyTorch
In this code, I'll construct a character-level LSTM with PyTorch. The network will train
character by character on some text, then generate new text character by character.
This model will be able to generate new text based on the text from any provided book!
This network is based off of Udacity RNN mini project and which is in turn based off of Andrej Karpathy's
post on RNNs and implementation in Torch.
@spencerzhang91
spencerzhang91 / dmlp.py
Created November 24, 2017 08:44 — forked from mick001/dmlp.py
Deep MLP in Tensorflow.
import tensorflow as tf
import pandas as pd
from sklearn.cross_validation import train_test_split
FILE_PATH = '~/Desktop/bank-add/bank_equalized.csv' # Path to .csv dataset
raw_data = pd.read_csv(FILE_PATH) # Open raw .csv
print("Raw data loaded successfully...\n")
#------------------------------------------------------------------------------
# Variables