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 documents to clusters | |
This script will run through a list of docs and process out the groups the docs may belong to using | |
cluster analysis, NMF and TF*IDF for preprocessing. These are some basic techniques for unsupervised NLP | |
which may be very handy. | |
""" | |
# For creating the data structure to process |
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 archlinux/base:latest | |
# Basic dependencies | |
RUN pacman -Syu --noconfirm | |
RUN pacman -S tar curl sudo grep base-devel --noconfirm | |
RUN mkdir -p /opt/yay/ | |
WORKDIR /opt/yay/ | |
# Add the builduser (cant install yay as root) | |
RUN useradd builduser -m # Create the builduser |
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
resource "google_service_account" "sa" { | |
account_id = "my-service-account" | |
display_name = "A service account that Jane can use, with some pubsub capabilities" | |
} | |
# Allow SA service account use of the default GCE account | |
# https://www.terraform.io/docs/providers/google/r/google_service_account_iam.html | |
resource "google_service_account_iam_member" "gce-default-account-iam" { | |
service_account_id = data.google_compute_default_service_account.default.name | |
role = "roles/iam.serviceAccountUser" |
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
def train_model(): | |
# ... Define the model and training data etc here | |
def my_callback(epoch, logs): | |
# Optionally clear the file if it exists here? or use on_train_begin cb | |
# Focus on the point here | |
with open('train_logs.json', 'a') as l: | |
data =json.dumps({'epoch': epoch, **logs}) | |
l.write(data + '\n') |
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
#!/usr/bin/env python | |
"""Logging setup | |
To use this module, just import it to set up the logger. It should persist from import across the runtime | |
""" | |
import logging |
OlderNewer