<jupyter_start><jupyter_text>Basic Tutorial for TensorFlow<jupyter_code>!pip -q install aquvitae
!wget -q --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1D28_TKauDVFO2nVlUeK_fuZX85zAO5o4' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1D28_TKauDVFO2nVlUeK_fuZX85zAO5o4" -O teacher.h5 && rm -rf /tmp/cookies.txt
import tensorflow as tf

from aquvitae import dist, ST
dataset = tf.keras.datasets.cifar10

(x_train, y_train), (x_test, y_test) = dataset.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
train_ds = tf.data.Dataset.from_tensor_slices(
    (x_train, y_train)).shuffle(10000).batch(64)
test_ds = tf.data.Dataset.from_tensor_slices((x_test, y_test)).batch(64)
teacher = tf.keras.applications.ResNet50(weights=None, input_shape=(32, 32, 3), classes=10)
teacher.load_weights('teacher.h5')
student = tf.keras.applications.MobileNetV2(weights=None, input_shape=(32, 32, 3), classes=10)
student = dist(
    teacher=teacher,
    student=student,
    algo=ST(alpha=0.6, T=2.5),
    optimizer=tf.keras.optimizers.Adam(),
    train_ds=train_ds,
    test_ds=test_ds,
    iterations=15000
)<jupyter_output>Training - 15000/15000 [██████████████████████████████] ELP: 09:26, accuracy: 0.5490 - val_accuracy: 0.5501
{'fraction_non_alphanumeric': 0.17801418439716313, 'fraction_numerical': 0.06382978723404255, 'mean_word_length': 5.299107142857143, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '492864', 'license': 'MIT', 'n_tokens_mistral': 669, 'n_tokens_neox': 593, 'n_words': 88, 'path': 'tutorials/BasicTutorialForTensorFlow.ipynb', 'repo_name': 'marload/aquvitae', 'size': '1410'}