type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
// An example of using the PyTorch C++ API to implement a custom forward and backward function | |
#include <iostream> | |
#include <vector> | |
#include <torch/torch.h> | |
#include <torch/csrc/autograd/variable.h> | |
#include <torch/csrc/autograd/function.h> | |
#include <torch/csrc/autograd/VariableTypeUtils.h> | |
#include <torch/csrc/autograd/functions/utils.h> |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
from selenium import webdriver | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support import expected_conditions as EC | |
import requests | |
import os | |
def download_all_papers(base_url, save_dir, driver_path): | |
driver = webdriver.Chrome(driver_path) |
# set a proxy | |
set HTTP_PROXY= | |
set HTTPS_PROXY=%HTTP_PROXY% | |
npm config set proxy %HTTP_PROXY% | |
npm config set https.proxy %HTTPS_PROXY% | |
npm config set https-proxy %HTTPS_PROXY% | |
git config --global http.proxy %HTTP_PROXY% | |
git config --global https.proxy %HTTPS_PROXY% | |
# unset proxy |
Hi! I'm your first Markdown file in StackEdit. If you want to learn about StackEdit, you can read me. If you want to play with Markdown, you can edit me. If you have finished with me, you can just create new files by opening the file explorer on the left corner of the navigation bar.
StackEdit stores your files in your browser, which means all your files are automatically saved locally and are accessible offline!
{-# LANGUAGE GADTs #-} | |
{- | |
The following code is based on experimental code by Aslan Askerov | |
based on Ramsey and Pfeffers "Stochastic Lambda Calculus and Monads of | |
Probability Distributions". Implementation of random n is from | |
Audebaud and Paulin-Mohring paper, so is the random walk example. | |
This gist is used here http://madsbuch.com/blog/the-probability-monad/ | |
The class hierarchy is as follows: |
import cv2 | |
import os | |
import sys | |
import random | |
out_dir = './my_faces' | |
if not os.path.exists(out_dir): | |
os.makedirs(out_dir) | |
name: "iris" | |
layer { | |
name: "data" | |
type: "HDF5Data" | |
top: "data" | |
top: "label" | |
include: { | |
phase: TRAIN | |
} | |
hdf5_data_param { |
import matplotlib.pyplot as plt | |
def draw_neural_net(ax, left, right, bottom, top, layer_sizes): | |
''' | |
Draw a neural network cartoon using matplotilb. | |
:usage: | |
>>> fig = plt.figure(figsize=(12, 12)) | |
>>> draw_neural_net(fig.gca(), .1, .9, .1, .9, [4, 7, 2]) | |
loss=tf.reduce_mean(-elbo) | |
lr=tf.constant(0.001) | |
train_op=tf.train.AdamOptimizer(learning_rate=lr).minimize(loss,var_list=slim.get_model_variables()) | |
init_op=tf.initialize_all_variables() | |
# get data | |
data = input_data.read_data_sets('/tmp/', one_hot=True).train | |
BATCH_SIZE=100 | |
NUM_ITERS=50000 | |
tau0=1.0 # initial temperature |