Note: Using Google Cloud is not free of charge!
Running Pytorch on Google Cloud TPUs
| python examples/persona_chatbot/pytorch/train.py \ | |
| --experiment-name persona-bot-6xMI100 \ | |
| --num-dataloader-workers 2 \ | |
| --use-mixed-precision \ | |
| --batch-size 30 \ | |
| --batch-chunk-size 10 \ | |
| --num-choices 8 \ | |
| --sequence-length-outlier-threshold 0.05 \ | |
| --learning-rate 6.25e-5 \ | |
| --lr-warmup-schedule \ |
| import tensorflow as tf | |
| import numpy as np | |
| def load_data(): | |
| fashion_mnist = tf.keras.datasets.fashion_mnist | |
| (train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data() | |
| # Adding a dimension to the array -> new shape == (28, 28, 1) |
Note: Using Google Cloud is not free of charge!
Running Pytorch on Google Cloud TPUs
| # This gist contains shared code for the Colab demo-chatbot.ipynb and demo-chatbot-inference.ipynb | |
| # Copyright Globescope and Freddy Snijder. | |
| # License "GNU General Public License v3.0" | |
| # Also see https://choosealicense.com/licenses/gpl-3.0/ | |
| from enum import Enum | |
| import re |
| from keras.layers import Input | |
| from keras.layers.recurrent import GRU, LSTM, SimpleRNN | |
| from keras.layers.wrappers import TimeDistributed | |
| from keras.layers.core import Dense, Activation, RepeatVector | |
| from keras.layers.merge import Concatenate | |
| from keras.layers import Dropout | |
| from keras.optimizers import Adam | |
| from keras.models import Model |
| I came across this compile error in XCode 4.3.2: In stl_function.h: | |
| typename _Operation::result_type | |
| operator()(const typename _Operation::second_argument_type& __x) const | |
| { return op(value, __x); } | |
| // _GLIBCXX_RESOLVE_LIB_DEFECTS | |
| // 109. Missing binders for non-const sequence elements | |
| typename _Operation::result_type | |
| operator()(typename _Operation::second_argument_type& __x) const <--------- Class member cannot be redeclared |