Formation of the neural network architecture of the model and downloading its weights to obtain features / scores based on deep features (audio modality)
_b5.audio_model_nn_- Нейросетевая модель nn.Module для получения признаков / оценок на базе нейросетевых признаков
Import required packages
[2]:
from oceanai.modules.lab.build import Run
Build
[3]:
_b5 = Run(
lang = 'en', # Interface 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
)
[2024-10-08 20:30:16] OCEANAI - персональные качества личности человека: Авторы: Рюмина Елена [ryumina_ev@mail.ru] Рюмин Дмитрий [dl_03.03.1991@mail.ru] Карпов Алексей [karpov@iias.spb.su] Сопровождающие: Рюмина Елена [ryumina_ev@mail.ru] Рюмин Дмитрий [dl_03.03.1991@mail.ru] Версия: 1.0.0a40 Лицензия: BSD License
Formation of the neural network architecture of the model
[4]:
res_load_audio_model_nn = _b5.load_audio_model_nn(
show_summary = False, # Display of the generated neural network архитектуры модели
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2024-10-08 20:30:17] Формирование нейросетевой архитектуры для получения оценок по нейросетевым признакам (аудио модальность) …
— Время выполнения: 1.072 сек. —
Downloading the weights of the neural network model
[5]:
# Настройки ядра
_b5.path_to_save_ = './models' # Директория для сохранения файла
_b5.chunk_size_ = 2000000 # Размер загрузки файла из сети за 1 шаг
url = _b5.weights_for_big5_['audio']['fi']['nn']['googledisk']
res_load_audio_model_weights_nn = _b5.load_audio_model_weights_nn(
url = url, # Полный путь к файлу с весами нейросетевой модели
force_reload = True, # Принудительная загрузка файла с весами нейросетевой модели из сети
out = True, # Отображение
runtime = True, # Подсчет времени выполнения
run = True # Блокировка выполнения
)
[2024-10-08 20:30:18] Загрузка весов нейросетевой модели для получения оценок по нейросетевым признакам (аудио модальность) …
[2024-10-08 20:30:22] Загрузка файла “weights_2022-05-03_07-46-14.pth” 100.0% …
— Время выполнения: 4.371 сек. —
Displaying the formed neural network architecture of the model
[6]:
_b5.audio_model_nn_
[6]:
audio_model_nn(
(vgg): VGG(
(features): Sequential(
(0): Conv2d(3, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(1): ReLU(inplace=True)
(2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(3): ReLU(inplace=True)
(4): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(5): Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(6): ReLU(inplace=True)
(7): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(8): ReLU(inplace=True)
(9): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(10): Conv2d(128, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(11): ReLU(inplace=True)
(12): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(13): ReLU(inplace=True)
(14): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(15): ReLU(inplace=True)
(16): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(17): Conv2d(256, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(18): ReLU(inplace=True)
(19): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(20): ReLU(inplace=True)
(21): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(22): ReLU(inplace=True)
(23): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(24): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(25): ReLU(inplace=True)
(26): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(27): ReLU(inplace=True)
(28): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(29): ReLU(inplace=True)
(30): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
)
(avgpool): AdaptiveAvgPool2d(output_size=(7, 7))
(classifier): Identity()
)
(flatten): Flatten(start_dim=1, end_dim=-1)
(fc1): Linear(in_features=25088, out_features=512, bias=True)
(relu): ReLU()
(dropout): Dropout(p=0.5, inplace=False)
(fc2): Linear(in_features=512, out_features=256, bias=True)
(fc3): Linear(in_features=256, out_features=5, bias=True)
)