<jupyter_start><jupyter_text>Tensor Processing Units (TPUs)- TPUs are now available on Kaggle, for free  Enabling the TPU with Tensorflow<jupyter_code># detect and init the TPU
tpu = tf.distribute.cluster_resolver.TPUClusterResolver()
tf.config.experimental_connect_to_cluster(tpu)
tf.tpu.experimental.initialize_tpu_system(tpu)

# instantiate a distribution strategy
tpu_strategy = tf.distribute.experimental.TPUStrategy(tpu)<jupyter_output><empty_output><jupyter_text>Define you model  and the hyperparameters<jupyter_code># instantiating the model in the strategy scope creates the model on the TPU
with tpu_strategy.scope():
    model = tf.keras.Sequential( … ) # define your model normally
    model.compile( … )<jupyter_output><empty_output><jupyter_text>Run the model<jupyter_code># train model normally
model.fit(training_dataset, epochs=EPOCHS, steps_per_epoch=…)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08647450110864745, 'fraction_numerical': 0.0, 'mean_word_length': 7.6826923076923075, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '597024', 'license': 'MIT', 'n_tokens_mistral': 310, 'n_tokens_neox': 299, 'n_words': 70, 'path': 'Running_with_TPU.ipynb', 'repo_name': 'abhishekdabas31/Computer_Vision-Classification_Problem', 'size': '902'}