This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
环境: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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |