<jupyter_start><jupyter_text>Calculate Model  of Parameters and FLOPS<jupyter_code>import tensorflow as tf
from VCWA import AttentionModels, AttentionModelsResNet
from keras_flops import get_flops<jupyter_output><empty_output><jupyter_text>ResNet50v2<jupyter_code>model = tf.keras.applications.ResNet50V2(classes=100, weights=None)
model.summary()
get_flops(model, batch_size=1)
model = AttentionModelsResNet.create_L2PA_ResNet50v2(classes=100)
model.summary()
get_flops(model, batch_size=1)
model = AttentionModelsResNet.create_AttentionGated_ResNet50v2(classes=100)
model.summary()
get_flops(model, batch_size=1)
model = AttentionModelsResNet.create_AttentionGatedGrid_ResNet50v2(classes=100)
model.summary()
get_flops(model, batch_size=1)
model = AttentionModelsResNet.create_ResidualAttention_ResNet50v2(classes=100)
model.summary()
get_flops(model, batch_size=1)
model = AttentionModelsResNet.create_CBAM_ResNet50v2(classes=100)
model.summary()
get_flops(model, batch_size=1)<jupyter_output><empty_output><jupyter_text>MobileNet<jupyter_code>model = tf.keras.applications.MobileNetV2(classes=100, weights=None)
model.summary()
model.summary()
get_flops(model, batch_size=1)
model = AttentionModels.create_L2PA_MobileNetV2(classes=100)
get_flops(model, batch_size=1)
model = AttentionModels.create_AttentionGated_MobileNetV2(classes=100)
model.summary()
get_flops(model, batch_size=1)
model = AttentionModels.create_AttentionGatedGrid_MobileNetV2(classes=100)
model.summary()
get_flops(model, batch_size=1)
model = AttentionModels.create_ResidualAttention_MobileNetV2(classes=100)
model.summary()
get_flops(model, batch_size=1)
model = AttentionModels.create_CBAM_MobileNetV2(classes=100)
model.summary()
get_flops(model, batch_size=1)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10118711136235162, 'fraction_numerical': 0.04352741661955907, 'mean_word_length': 13.873949579831933, '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': '616901', 'license': 'Apache-2.0', 'n_tokens_mistral': 688, 'n_tokens_neox': 651, 'n_words': 78, 'path': 'flops.ipynb', 'repo_name': 'zr123/VideoClassificationWithAttention', 'size': '1769'}