This file contains hidden or 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
pipeline: | |
- name: WhitespaceTokenizer | |
- name: CRFEntityExtractor | |
- name: CountVectorsFeaturizer | |
OOV_token: "oov" | |
token_pattern: (?u)\b\w+\b | |
- name: CountVectorsFeaturizer | |
analyzer: "char_wb" | |
min_ngram: 1 | |
max_ngram: 4 |
This file contains hidden or 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
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | |
<script src="https://d3js.org/d3.v5.min.js"></script> | |
<div class="container" style="width=600px; margin: 0 auto;"> | |
<h2>DIET Interactive Demo</h2> | |
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" viewBox="-0.5 -0.5 1832 1057"> | |
<defs> | |
<linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-fff2cc-1-ffd966-1-s-0"> | |
<stop offset="0%" style="stop-color:#fff2cc"/> |
This file contains hidden or 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
language: en | |
pipeline: | |
- name: WhitespaceTokenizer | |
- name: CountVectorsFeaturizer | |
- name: EmbeddingIntentClassifier | |
policies: | |
- name: EmbeddingPolicy | |
max_history: 10 | |
epochs: 100 | |
batch_size: |
This file contains hidden or 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 numpy as np | |
import matplotlib.pylab as plt | |
def run_with_samples(feats=1): | |
n = 1000 | |
xs = np.random.uniform(0, 2, (n, feats)) | |
ys = 1.5 + xs.sum(axis=1) + np.random.normal(0, 1, (n,)) | |
size_subset = 500 | |
n_samples = 2000 |
This file contains hidden or 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
x | y | z | |
---|---|---|---|
575.9169941454602 | 456.4364641163653 | b | |
524.7679233463399 | 454.659622813655 | b | |
536.1853203147283 | 414.6387874887763 | b | |
554.7345847720682 | 392.6003138461853 | b | |
558.7216445350003 | 455.7009797890023 | b | |
512.1738453368777 | 407.6844578991705 | b | |
494.68119055863497 | 379.00447835274645 | b | |
521.4275424582694 | 409.29480593833387 | b | |
504.69631038511756 | 417.3711528143935 | b |
This file contains hidden or 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 uuid | |
import json | |
import random | |
import keras | |
import numpy as np | |
import tensorflow as tf | |
import click | |
This file contains hidden or 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
async def fetch(url, json_body, session): | |
async with session.post(url, json=json_body) as response: | |
return await response.read() | |
async def run(json_bodies, n_sim=1000): | |
tasks = [] | |
url = make_url(n_sim=n_sim) | |
# Fetch all responses within one Client session, | |
# keep connection alive for all requests. | |
async with ClientSession(connector=TCPConnector(limit=None), read_timeout=60000, conn_timeout=60000) as session: |
This file contains hidden or 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 random | |
import math | |
from chalice import Chalice | |
app = Chalice(app_name='sushigo-algorithm') | |
app.debug = False | |
def sort_hand(hand, order): | |
card_dict = {card: i for i, card in enumerate(order)} | |
return sorted(hand, key=lambda x: card_dict[x]) |
This file contains hidden or 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 numpy as np | |
import os | |
import uuid | |
TENSORBOARD_PATH = "/tmp/tensorboard-switchpoint" | |
# tensorboard --logdir=/tmp/tensorboard-switchpoint | |
x1 = np.random.randn(35) - 1 | |
x2 = np.random.randn(35) * 2 + 5 |
This file contains hidden or 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 numpy as np | |
import os | |
import uuid | |
TENSORBOARD_PATH = "/tmp/tensorboard-switchpoint" | |
# tensorboard --logdir=/tmp/tensorboard-switchpoint | |
x1 = np.random.randn(35)-1 | |
x2 = np.random.randn(35)*2 + 5 |