This file contains 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
model_config_list: { | |
config: { | |
name: "bag", | |
base_path: "s3://.../bag_model", | |
model_platform: "tensorflow", | |
model_version_policy: { | |
all: {} | |
} | |
}, | |
config: { |
This file contains 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
val nDays = 450 | |
df | |
.withColumn("date_merge", concat_ws("-", $"year", $"month", $"day")) | |
.withColumn("date", to_date(unix_timestamp($"date_merge", "yyyy-MM-dd").cast("timestamp"))) | |
.drop("date_merge") | |
.where($"date" >= date_add(current_date(), -nDays))) |
This file contains 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
Brother HL-2140 Foomatic/hpijs-pcl5e | |
sudo apt-get install hpijs-ppds printer-driver-hpijs |
This file contains 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 tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file | |
print_tensors_in_checkpoint_file( | |
file_name='/tmp/tensorboard-logs/tophat-movielens/20180530T140423/model.ckpt', | |
tensor_name=None, all_tensors=False, | |
all_tensor_names=True, | |
) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
""" | |
Pretty efficient way to sample negatives using binary search. | |
Imagine `pos_inds` are items a user has interacted with, | |
and we want a vectorized approach to uniformly sample many negative items. | |
This is better than (in the case where `n_samp` is large) | |
sampling from the entire catalog and then checking if it's a positive item. | |
Ahem... negative sampling for sparse interaction matrices. | |
""" |
This file contains 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 bisect import bisect_left | |
def in_bs(a, x): | |
i = bisect_left(a, x) | |
return (i != len(a)) and (a[i] == x) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.