Skip to content

Instantly share code, notes, and snippets.

View ntakouris's full-sized avatar
🤖
Building robots

Theodoros Ntakouris ntakouris

🤖
Building robots
View GitHub Profile
from functools import partial
from typing import Any, Dict, List, Text
from absl import logging
import tensorflow as tf
import tensorflow.keras.backend as K
import tensorflow_transform as tft
import tensorflow_data_validation as tfdv
class StrategyState:
# immutable. each new version is made through a series of recorded actions
# and a new copy is produced
@classmethod
def load(bytes): # or json or sth
pass
class TradingContext:
# provides states, action handlers
# behind the scenes propagates to different systems (filesystem, dbs, callbacks) via config
from enum import Enum, auto
class FeedStatus(Enum):
INIT = auto()
CONNECTED = auto()
PAUSED = auto()
CRASHED = auto()
from typing import List
n_dogs = 1
n_walkers = 1
dogs = []
# ------
def entrypoint():
groups = [((float('-inf'), float('inf')), 0) for w in range(n_walkers)]
valid, r = helper(groups, float('inf'))
# model creation
input_layers = {
colname: tf.keras.layers.Input(name=colname, shape=(1,), dtype=tf.int32)
for colname in ['user_id', 'movie_id']
}
user_id_input = input_layers['user_id']
movie_id_input = input_layers['movie_id']
=== quantizable_default_32_4_3_2_half_width ===
threshold = 0
32 bits => 0.6842 top1_acc
4 bits => 0.6819 top1_acc
3 bits => 0.6761 top1_acc
2 bits => 0.6558 top1_acc
threshold = 0.1
32 bits => 0.0645 top1_acc
4 bits => 0.6752 top1_acc
=== quantizable_default_8_4_3_2 ===
threshold = 0
32 bits => 0.7173 top1_acc
8 bits => 0.7177 top1_acc
4 bits => 0.7179 top1_acc
3 bits => 0.7176 top1_acc
2 bits => 0.7017 top1_acc
threshold = 0.1
32 bits => 0.0184 top1_acc
=== quantizable_default_32_3_2 ===
threshold = 0
32 bits => 0.7156 top1_acc
3 bits => 0.7113 top1_acc
2 bits => 0.7034 top1_acc
threshold = 0.1
32 bits => 0.0112 top1_acc
3 bits => 0.7113 top1_acc
2 bits => 0.7034 top1_acc
=== l1_1e-6_quantizable_default_thresholding_32_4_3_2 ===
threshold = 0
32 bits => 0.6854 top1_acc
4 bits => 0.0152 top1_acc
3 bits => 0.0102 top1_acc
2 bits => 0.0102 top1_acc
threshold = 0.1
32 bits => 0.0537 top1_acc
4 bits => 0.6549 top1_acc
=== l1_1e-5_quantizable_32_4_3_2 ===
threshold = 0
32 bits => 0.7184 top1_acc
4 bits => 0.7166 top1_acc
3 bits => 0.7161 top1_acc
2 bits => 0.6945 top1_acc
threshold = 0.1
32 bits => 0.0174 top1_acc
4 bits => 0.6921 top1_acc