Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mulltimodal pipeline improvement #581

Merged
merged 3 commits into from
Apr 7, 2022
Merged

Mulltimodal pipeline improvement #581

merged 3 commits into from
Apr 7, 2022

Conversation

andreygetmanov
Copy link
Collaborator

Fixes in composer's work, minor changes and optimization of multimodal tools

@andreygetmanov andreygetmanov requested a review from nicl-nno March 1, 2022 19:15
@pep8speaks
Copy link

pep8speaks commented Mar 1, 2022

Hello @andreygetmanov! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-04-07 14:19:52 UTC

@andreygetmanov andreygetmanov force-pushed the multimodal branch 3 times, most recently from 3000903 to b5e8871 Compare March 1, 2022 19:23
Comment on lines 117 to 137
train_text, test_text)

pipeline.fit(input_data=fit_data)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На строчке pipeline.fit(input_data=fit_data) выпадает ошибка
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В датасете много классов + он достаточно дисбалансный, поэтому при разделении на train/test не все классы попадали в обе выборки. Поменял датасет, сократил число классов, теперь должно работать.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поэтому при разделении на train/test не все классы попадали в обе выборки

Хорошо бы это починить, конечно. Но можно отдельным PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хорошо бы это починить, конечно.

В этом примере используется небольшой датасет. Подумал, что поменять датасет и сократить число классов - норм идея для демонстрации примера. Но можно и что-то другое сделать, наверное.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю пока можно действительно оставить упрощенный вариант, а уже последующими PR организовать возможность нормально работать с сильно несбалансированными датасетами

@andreygetmanov andreygetmanov force-pushed the multimodal branch 3 times, most recently from 093fc5c to 3d89d56 Compare March 15, 2022 15:04
@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #581 (9716b28) into master (3fa9b2f) will decrease coverage by 0.04%.
The diff coverage is 89.79%.

@@            Coverage Diff             @@
##           master     #581      +/-   ##
==========================================
- Coverage   86.51%   86.47%   -0.05%     
==========================================
  Files         153      153              
  Lines       11208    11230      +22     
==========================================
+ Hits         9697     9711      +14     
- Misses       1511     1519       +8     
Impacted Files Coverage Δ
fedot/core/operations/evaluation/text.py 75.25% <50.00%> (-1.34%) ⬇️
...lementations/data_operations/text_preprocessing.py 89.85% <86.66%> (-2.21%) ⬇️
fedot/core/data/data.py 87.81% <88.88%> (+4.34%) ⬆️
fedot/core/data/load_data.py 91.91% <100.00%> (+0.16%) ⬆️
...ore/operations/evaluation/evaluation_interfaces.py 89.38% <100.00%> (+1.53%) ⬆️
...aluation/operation_implementations/models/keras.py 86.31% <100.00%> (+0.44%) ⬆️
fedot/core/validation/compose/time_series.py 86.36% <0.00%> (-13.64%) ⬇️
...on_implementations/models/discriminant_analysis.py 91.78% <0.00%> (-4.11%) ⬇️
fedot/core/composer/gp_composer/gp_composer.py 85.83% <0.00%> (-2.50%) ⬇️
fedot/core/optimisers/gp_comp/evaluating.py 68.25% <0.00%> (-1.59%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fa9b2f...9716b28. Read the comment docs.

@andreygetmanov andreygetmanov force-pushed the multimodal branch 2 times, most recently from 0c27d48 to 32353a4 Compare April 1, 2022 15:54
@nicl-nno nicl-nno requested a review from Dreamlone April 1, 2022 16:30
@Dreamlone Dreamlone linked an issue Apr 2, 2022 that may be closed by this pull request
Copy link
Collaborator

@Dreamlone Dreamlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ещё стоит написать тест на мультимодальную функциональность, которая уже есть. Вроде таких тестов ещё нет, по крайней мере я не нашёл для случая "картинки + текст + таблицы"

Copy link
Collaborator

@Dreamlone Dreamlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом все ок, осталось только с random_state = 42 ещё разобраться. Может @nicl-nno подскажет стоит ли вводить тут определение random_state через randint, чтобы разбиение все таки отличалось от запуска к запуску. Или это для чего-то конкретного так задумывалось?

@Dreamlone
Copy link
Collaborator

Ну и unit тест ещё нужен - стоит не забыть

@andreygetmanov
Copy link
Collaborator Author

Ещё стоит написать тест на мультимодальную функциональность, которая уже есть. Вроде таких тестов ещё нет, по крайней мере я не нашёл для случая "картинки + текст + таблицы"

https://github.com/nccr-itmo/FEDOT/blob/master/test/unit/pipelines/test_multi_modal.py

Этот тест генерирует и запускает пайплайн для случая "картинки + текст + таблицы". Нужно как-то дополнить его функционал? Не совсем понимаю, что можно в него добавить

@nicl-nno
Copy link
Collaborator

nicl-nno commented Apr 6, 2022

чтобы разбиение все таки отличалось от запуска к запуску

Да вроде в примере это не обязательно.

@Dreamlone
Copy link
Collaborator

Dreamlone commented Apr 7, 2022

Да вроде в примере это не обязательно.

Для примера - определенно необязательно. Но мой вопрос про то, стоит ли оставлять такой хардкод во внутренних функциях. То есть если random seed не меняется в _split_any никогда, алгоритм всегда будет делать одно и то же разбиение на всех запусках

Copy link
Collaborator

@Dreamlone Dreamlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сделай пожалуйста ребейз, и думаю, можно мерджить

@nicl-nno
Copy link
Collaborator

nicl-nno commented Apr 7, 2022

Да вроде в примере это не обязательно.

Для примера - определенно необязательно. Но мой вопрос про то, стоит ли оставлять такой хардкод во внутренних функциях. То есть если random seed не меняется в _split_any никогда, алгоритм всегда будет делать одно и то же разбиение на всех запусках

Ок, это действительно можно убрать. Хотя оно и не в этом PR-е появилось.

@andreygetmanov
Copy link
Collaborator Author

Ок, это действительно можно убрать. Хотя оно и не в этом PR-е появилось.

Создать issue по этому поводу?

- fixed the optimizer error in multimodal pipeline
- fixed the bug #564 'Example multi_modal_pipeline_genres failed'
- deleted the example of rating prediction
- optimized the process of NLP libraries import
- changed the data for multimodal example
- upgraded stemmer from Porter to Snowball
- fixed bug of merging multimodal data
- fixed bug of multimodal data shuffling while loading
- CNN now works on multioutput task
- Fixed the bug with incorrect type and shape of multioutput predictions
- removed warning during scaling image data
- minor changes for readability
- test_multi_modal.py is changed accordingly to new structure of multi_modal_pipeline.py
- now there is no useless try of download of stopwords and other nltk packages if they are already downloaded
- keras.Input changed to recommended keras.layers.InputLayer
- test_multi_modal.py is moved to multimodal folder
@nicl-nno
Copy link
Collaborator

nicl-nno commented Apr 7, 2022

Можешь просто убрать.

@Dreamlone
Copy link
Collaborator

Можешь просто убрать.

Ладно, давай уже не в этом PR, предлагаю отдельно снести

@andreygetmanov andreygetmanov merged commit 92aede4 into master Apr 7, 2022
@andreygetmanov andreygetmanov deleted the multimodal branch April 13, 2022 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example multi_modal_pipeline_genres failed
4 participants