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
{ | |
"TE_HleLWmIEPwt569RVRcHqHGTtAlY": {"id": "TE_HleLWmIEPwt569RVRcHqHGTtAlY", | |
"name": "make_coffee", | |
"match": [], | |
"kind": "TaskEx", | |
"parent_id": "", | |
"child_ids": ["ME_f5pppcjn3EsLGzH0L17bKykXzxs", | |
"ME_HkJlmBZS2IepxAFU8hNpw225IHY", | |
"ME_ntNBRSRh0CaFaULjeJpWlVitRQQ"], | |
"status": "IN_PROGRESS", |
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 numba | |
import numpy as np | |
import numba | |
from numba import types, jit,njit, generated_jit | |
from numba import deferred_type, optional | |
from numba import void,b1,u1,u2,u4,u8,i1,i2,i4,i8,f4,f8,c8,c16 | |
from numba.typed import List, Dict | |
from numba.types import ListType, unicode_type, UnicodeType | |
from numba.cpython.unicode import _empty_string, _set_code_point, _get_code_point, PY_UNICODE_1BYTE_KIND | |
from numba.extending import overload, overload_method |
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
from numba import njit, cfunc | |
from numba.types import unicode_type, i8 | |
import time | |
class PrintElapse(): | |
def __init__(self, name): | |
self.name = name | |
def __enter__(self): | |
self.t0 = time.time_ns()/float(1e6) | |
def __exit__(self,*args): |
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
from numba import njit, f8 | |
from numba.typed import List | |
from numba.extending import models, register_model | |
class Interval(object): | |
""" | |
A half-open interval on the real number line. | |
""" | |
def __init__(self, lo, hi): | |
self.lo = lo |
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
from numba import njit, f8 | |
from numba.typed import List | |
from numba.extending import models, register_model | |
class Interval(object): | |
""" | |
A half-open interval on the real number line. | |
""" |
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
# Chris Questions: | |
# Calling all inputs and outputs 'foas' is a little confusing? | |
# In training why does HowSearch run at the beginning and then only get used when there are no explanations? | |
# Nitty Gritty Questions: | |
# Does the when learner need to include foas & selection in search? | |
# -How do we support the possibility that it does/doesn't | |
# -are there accuracy/opp differences if only operating on the state without expanding / querying over all the foas/selections? |
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 sys, glob, os, re | |
print(len(sys.argv)) | |
if(len(sys.argv) < 3): | |
print("Proper Usage:") | |
print("%s <input.brd or folder w/ .brds> <output file or folder>" % sys.argv[0]) | |
exit() | |
inp = os.path.abspath(sys.argv[1]); | |
out = os.path.abspath(sys.argv[2]); |
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
class Attention(Layer): | |
def __init__(self, | |
W_regularizer=None, b_regularizer=None, | |
W_constraint=None, b_constraint=None, | |
bias=True, **kwargs): | |
""" | |
Keras Layer that implements an Attention mechanism for temporal data. | |
Supports Masking. | |
Follows the work of Raffel et al. [https://arxiv.org/abs/1512.08756] | |
# Input shape |
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
class AttentionWithContext(Layer): | |
""" | |
Attention operation, with a context/query vector, for temporal data. | |
Supports Masking. | |
Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf] | |
"Hierarchical Attention Networks for Document Classification" | |
by using a context vector to assist the attention | |
# Input shape | |
3D tensor with shape: `(samples, steps, features)`. | |
# Output shape |