Formation of neural network architectures of models and downloading their weights to obtain the personality traits scores (audio, video and tex fusion)


  • _b5.avt_model_b5_ - Neural network model tf.keras.Model for obtaining the personality traits scores

Import required packages

[2]:
from oceanai.modules.lab.build import Run

Build

[3]:
_b5 = Run(
    lang = 'en',              # Inference language
    color_simple = '#333',    # Plain text color (hexadecimal code)
    color_info = '#1776D2',   # The color of the text containing the information (hexadecimal code)
    color_err = '#FF0000',    # Error text color (hexadecimal code)
    color_true = '#008001',   # Text color containing positive information (hexadecimal code)
    bold_text = True,         # Bold text
    num_to_df_display = 30,   # Number of rows to display in tables
    text_runtime = 'Runtime', # Runtime text
    metadata = True           # Displaying information about library
)

[2023-12-14 22:44:38] OCEANAI - personal traits:    Authors:        Elena Ryumina [ryumina_ev@mail.ru]        Dmitry Ryumin [dl_03.03.1991@mail.ru]        Alexey Karpov [karpov@iias.spb.su]    Maintainers:        Elena Ryumina [ryumina_ev@mail.ru]        Dmitry Ryumin [dl_03.03.1991@mail.ru]    Version: 1.0.0a5    License: BSD License

Formation of neural network architectures of models

[4]:
res_load_avt_model_b5 = _b5.load_avt_model_b5(
    show_summary = False, # Displaying the formed neural network architecture of the model
    out = True,           # Display
    runtime = True,       # Runtime count
    run = True            # Run blocking
)

[2023-12-11 09:46:45] Formation of neural network architectures of models for obtaining the personality traits scores (multimodal fusion) …

— Runtime: 0.814 sec. —

Downloading weights of neural network models

[5]:
# Core settings
_b5.path_to_save_ = './models' # Directory to save the file
_b5.chunk_size_ = 2000000      # File download size from network in 1 step

url = _b5.weights_for_big5_['avt']['fi']['b5']['sberdisk']

res_load_avt_model_weights_b5 = _b5.load_avt_model_weights_b5(
    url = url,
    force_reload = False, # Forced download of a file with weights of a neural network model from the network
    out = True,           # Display
    runtime = True,       # Runtime count
    run = True            # Run blocking
)

[2023-12-11 09:46:46] Downloading the weights of neural network models to obtain the personality traits scores (multimodal fusion) …

[2023-12-11 09:46:46] File download “avt_fi_2023-12-03_11-36-51.h5”

— Runtime: 0.218 sec. —

Displaying the formed neural network architecture of the model

[6]:
_b5.avt_model_b5_.summary()
Model: "model"
__________________________________________________________________________________________________
 Layer (type)                   Output Shape         Param #     Connected to
==================================================================================================
 hc_t (InputLayer)              [(None, 128)]        0           []

 hc_a (InputLayer)              [(None, 256)]        0           []

 nn_t (InputLayer)              [(None, 128)]        0           []

 nn_a (InputLayer)              [(None, 512)]        0           []

 hc_v (InputLayer)              [(None, 256)]        0           []

 nn_v (InputLayer)              [(None, 2048)]       0           []

 ln_hc_t (LayerNormalization)   (None, 128)          256         ['hc_t[0][0]']

 ln_hc_a (LayerNormalization)   (None, 256)          512         ['hc_a[0][0]']

 ln_nn_t (LayerNormalization)   (None, 128)          256         ['nn_t[0][0]']

 ln_nn_a (LayerNormalization)   (None, 512)          1024        ['nn_a[0][0]']

 ln_hc_v (LayerNormalization)   (None, 256)          512         ['hc_v[0][0]']

 ln_nn_v (LayerNormalization)   (None, 2048)         4096        ['nn_v[0][0]']

 gata (GFL)                     (None, 64)           131072      ['ln_hc_t[0][0]',
                                                                  'ln_hc_a[0][0]',
                                                                  'ln_nn_t[0][0]',
                                                                  'ln_nn_a[0][0]']

 gatv (GFL)                     (None, 64)           327680      ['ln_hc_t[0][0]',
                                                                  'ln_hc_v[0][0]',
                                                                  'ln_nn_t[0][0]',
                                                                  'ln_nn_v[0][0]']

 gaav (GFL)                     (None, 64)           393216      ['ln_hc_a[0][0]',
                                                                  'ln_hc_v[0][0]',
                                                                  'ln_nn_a[0][0]',
                                                                  'ln_nn_v[0][0]']

 tf.concat (TFOpLambda)         (None, 192)          0           ['gata[0][0]',
                                                                  'gatv[0][0]',
                                                                  'gaav[0][0]']

 dense (Dense)                  (None, 50)           9650        ['tf.concat[0][0]']

 dence_cl (Dense)               (None, 5)            255         ['dense[0][0]']

==================================================================================================
Total params: 868,529
Trainable params: 868,529
Non-trainable params: 0
__________________________________________________________________________________________________