First of all install update and upgrade your system:
$ sudo apt update
$ sudo apt upgradeThen, install required libraries:
| import gym | |
| from gym.envs.registration import register | |
| from gym import error, spaces, utils | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| import pandas_datareader.data as web | |
| import arrow | |
| import random | |
| import sys |
jq — https://jqlang.org/ — "like sed for JSON data"
There are several options available for installing jq.
I prefer to use Homebrew: brew install jq
| # Step - Submit Predictions | |
| # We have finished training and ready to run predictions on the test set. | |
| log_test_preds = learn.predict(is_test=True) | |
| # Convert log predictions to just probabilities (predictions). | |
| test_preds = np.exp(log_test_preds) | |
| # Create the submission file using the probabilities | |
| # Get a list of image file names from the test data loader | |
| im_fnames = data.test_dl.dataset.fnames |
| from model import Net | |
| from trainer import Trainer | |
| import torch | |
| from torch import nn | |
| from matplotlib import pyplot as plt | |
| model = Net() | |
| ckpt = torch.load('path_to_checkpoint') | |
| model.load_state_dict(ckpt['state_dict']) | |
| filter = model.conv1.weight.data.numpy() |
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
| #!flask/bin/python | |
| from flask import Flask, jsonify, abort, request, make_response, url_for | |
| from flask_httpauth import HTTPBasicAuth | |
| app = Flask(__name__, static_url_path = "") | |
| auth = HTTPBasicAuth() | |
| @auth.get_password | |
| def get_password(username): | |
| if username == 'miguel': |
Simplest intro to git by github and codeschool - Try Git
[Intro to github]