- Introduces a new global log-bilinear regression model which combines the benefits of both global matrix factorization and local context window methods.
- Decompose large matrices into low-rank approximations.
| #! /usr/bin/env python | |
| """ | |
| Author: Jeremy M. Stober | |
| Program: SOFTMAX.PY | |
| Date: Wednesday, February 29 2012 | |
| Description: Simple softmax function. | |
| """ | |
| import numpy as np | |
| npa = np.array |
| #!/bin/bash | |
| mkdir -p ~/.ssh | |
| # generate new personal ed25519 ssh keys | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>" | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>" | |
| # generate new host cert authority (host_ca) ed25519 ssh key | |
| # used for signing host keys and creating host certs |
| """ | |
| 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) |
| from math import sqrt | |
| def put_kernels_on_grid (kernel, pad = 1): | |
| '''Visualize conv. filters as an image (mostly for the 1st layer). | |
| Arranges filters into a grid, with some paddings between adjacent filters. | |
| Args: | |
| kernel: tensor of shape [Y, X, NumChannels, NumKernels] | |
| pad: number of black pixels around each filter (between them) |
| # | |
| # mnist_cnn_bn.py date. 5/21/2016 | |
| # date. 6/2/2017 check TF 1.1 compatibility | |
| # | |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import os |
| from __future__ import print_function | |
| import requests | |
| import json | |
| import cv2 | |
| addr = 'http://localhost:5000' | |
| test_url = addr + '/api/test' | |
| # prepare headers for http request | |
| content_type = 'image/jpeg' |
| import tensorflow as tf | |
| import numpy as np | |
| corpus_raw = 'He is the king . The king is royal . She is the royal queen ' | |
| # convert to lower case | |
| corpus_raw = corpus_raw.lower() | |
| words = [] | |
| for word in corpus_raw.split(): |