Code for Keras plays catch blog post
python qlearn.py- Generate figures
| ;;; package --- Fix permissions for Emacs.app on macOS Catalina | |
| ;;; Author: Artem Loenko | |
| ;;; Mail-To: <[email protected]> | |
| ;;; Commentary: | |
| ;;; Code: | |
| (defconst _default-emacs-app-plist-path "/Applications/Emacs.app/Contents/Info.plist") | |
| (defconst _temp-buffer-name "*fixing Emacs permissions*") | |
| (defconst _temp-buffer (get-buffer-create _temp-buffer-name)) | |
| (with-current-buffer _temp-buffer (erase-buffer)) |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |
| """ | |
| Dynamic Routing Between Capsules | |
| https://arxiv.org/abs/1710.09829 | |
| """ | |
| import torch | |
| import torch.nn as nn | |
| import torch.optim as optim | |
| import torch.nn.functional as F | |
| import torchvision.transforms as transforms |
| library(tidyverse) | |
| # Data is downloaded from here: | |
| # https://www.kaggle.com/c/digit-recognizer | |
| kaggle_data <- read_csv("~/Downloads/train.csv") | |
| pixels_gathered <- kaggle_data %>% | |
| mutate(instance = row_number()) %>% | |
| gather(pixel, value, -label, -instance) %>% | |
| extract(pixel, "pixel", "(\\d+)", convert = TRUE) |
Code for Keras plays catch blog post
python qlearn.py| import os | |
| import numpy as np | |
| import scipy.ndimage as ndimage | |
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| def frac_eq_to(image, value=0): | |
| return (image == value).sum() / float(np.prod(image.shape)) | |
| def extract_patches(image, patchshape, overlap_allowed=0.5, cropvalue=None, |