Execute the following command to determine if your Kubernetes cluster is running in an environment that supports external load balancers:
kubectl get svc istio-ingressgateway -n istio-system
istioctl analyze
# Serving function that passes through keys | |
@tf.function(input_signature=[{ | |
'is_male': tf.TensorSpec([None,], dtype=tf.string, name='is_male'), | |
'mother_age': tf.TensorSpec([None,], dtype=tf.float32, name='mother_age'), | |
'plurality': tf.TensorSpec([None,], dtype=tf.string, name='plurality'), | |
'gestation_weeks': tf.TensorSpec([None,], dtype=tf.float32, name='gestation_weeks'), | |
'key': tf.TensorSpec([None,], dtype=tf.string, name='key') | |
}]) | |
def my_serve(inputs): | |
feats = inputs.copy() |
import datetime | |
dt = datetime.datetime.now() | |
now = dt.strftime('%Y%m%d_%H%M%S') | |
PROJECT_ID= "my-google-cloud-project-id" | |
MODEL_NAME='resnet50' | |
DATASET='imagenet' | |
EXPERIMENT_NAME=f"{MODEL_NAME}-{DATASET}" | |
JOB_NAME=f"{EXPERIMENT_NAME}-{now}" |
# The #power of a good #API #design: implement a whole paper in 2 lines of code and get 3x faster results: | |
dataset.flat_map( lambda t: | |
tf.data.Dataset.from_tensors(t).repeat(e)) | |
# from: Faster #NeuralNetwork Training with #Data Echoing https://arxiv.org/pdf/1907.05550.pdf #Tensorflow |
# The #power of a good #API #design: implement a whole paper in 2 lines of code and get 3x faster results: | |
dataset.flat_map( lambda t: | |
tf.data.Dataset.from_tensors(t).repeat(e)) | |
# from: Faster #NeuralNetwork Training with #Data Echoing https://arxiv.org/pdf/1907.05550.pdf #Tensorflow |
Projects audio files that contains one word of speech into a hyper-dimension space just like Word2Vec. Uses "Force Aligment" to split audio into words (which requires text). Pad the audio segments with zeros, do MFCC, feed into encoder-decoder which uses RMSE. They also add noise to the signal and make the network denoise it. LibriSpeech 500 hour of audio. Not sure how it can incorporated in an ASR or TTS systems. The audio file has to be paired with a text otherwise Speech2Vec cannot split the audio file into words using "Forced Alignment" method. It is used to query if the spoken word is similar to an existing word in the corpus.
BPE data compression tool that combines most frequent pair of bytes with one. It works well with Named Entity, loadwords and morphologically complex words. Handles OOVs well and rare words. You can
from google.cloud import storage | |
from tensorflow import MetaGraphDef | |
client = storage.Client() | |
bucket = client.get_bucket(Config.MODEL_BUCKET) | |
blob = bucket.get_blob('model.ckpt.meta') | |
model_graph = blob.download_as_string() | |
mgd = MetaGraphDef() | |
mgd.ParseFromString(model_graph) |
# Create layer slider | |
# Import all the necessary packages | |
import numpy as np | |
import nibabel as nib | |
from ipywidgets import interact, interactive, IntSlider, ToggleButtons | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
import seaborn as sns | |
sns.set_style('darkgrid') |
# from https://www.kaggle.com/cdeotte/cutmix-and-mixup-on-gpu-tpu | |
## CutMix Augmentation¶ | |
# The following code does cutmix using the GPU/TPU. | |
# Change the variables SWITCH, CUTMIX_PROB and MIXUP_PROB | |
# in function transform() to control the amount of augmentation during training. | |
# CutMix will occur SWITCH * CUTMIX_PROB often and | |
# MixUp will occur (1-SWITCH) * MIXUP_PROB often during training. | |
def onehot(image,label): | |
CLASSES = 104 |
from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau | |
reduce_lr = ReduceLROnPlateau( | |
monitor='val_loss', | |
factor=0.5, | |
patience=2, | |
verbose=1, | |
mode='auto', | |
min_lr=0.000001) |