«Ти не мати, а стихія!» — сварки з свекрухою довели Соломію до межі
Соломія стояла біля пліти, перевертаючи вареники, коли на кухню увійшов її чоловік.
— Соломію, мені сьогодні мати дзвонила, — почав Богдан. — Каже, ти її до онука не пускаєш.
— Скаржилась? — здивувалася Соломія.
— Ну так. Каже, ти постійно відмовляєш. Уже місяць Петрика не бачила, — додав він.
Соломія нервово витерла руки об фартух.
— Богдане… Мені важко це сказати, — вона завагалася. — Твоя мати… сказала мені дещо, що ти маєш знати.
Вона розповіла все. Богдан зблід і опустився на стілець — він такого не очікував.
Все почалося місяць тому. Того дня Марія Іванівна, його мати, як завжди, прийшла без попередження. З порогу окинула коридор поглядом:
— Знову безлад. Іграшки розкидані! У такому бруді дитину виховувати не можна!
Соломія напружено посміхнулася, але всередині у неї все стиснулося. Петрик щойно заснув, а іграшки лежали на підлозі, де він грав. Але для свекрухи це був привід вилити своє обурення.
— Богдане! — підвищила голос Марія. — Ти чоловік чи хто? Ти маєш показувати дружині, як вести господарство!
— Мамо, усе нормально, — буркнув він, не відриваючи очей від телефона.
— Це в тебе нормально? Дім немов після урагану, а ти ніби на відпочинку!
— Петрик просто енергійний, — спокійно вставила Соломія, але голос видавав напругу.
— Енергійний! Тобі б за ним дивитися, а не дозволяти йому по квартирі скакати!
І знову розмова звелася до того, що Богдан у дитинстві був майже під мікроскопом. Ідеальна дитина, вихована під пильною увагою. Соломія мовчки кивала, але з кожним словом усередині неї ріс протест.
— Маріє Іванівно, — нарешті сказала вона. — Я рощу сина за своїми переконаннями. Йому два роки. Він пізнає світ.
— Пізнає? А потім синці, подряпини, а ти лише «пізнає» і твердиш!
— Це діти. Вони вчать все через рух, помилки, досвід.
— Ні! Це твоя безалаберність. А якщо він собі щось серйозне зробить?
— Мамо… — втрутився Богдан, але свекруха лише запалилася ще більше.
— Якщо ти не навчишся бути нормальною матір’ю, я подумаю, куди звернутися!
Наступного дня вона знову прийшла — різко постукала, як завжди.
— Чому так довго відчиняєш? Я вже подумала, тебе вдома нема! — блиснула вона очима.
— Я була зайнята, — спокійно відповіла Соломія.
— Знову іграшки! Ти взагалі прибираєшся?
— Звісно. Але Петрик грає. Це нормально.
— Нормально? А в дитинстві Богдан… — почала свекруха.
— Так, знаю. Він був ідеальний. Ні порошинки, ні подряпини. Тільки от смажити млинці досі не вміє!
— �# Pytorch implementation on ResNet-based Vision Transformer (Res-ViT)
## Abstract
This paper proposes a hybrid model called ResNet-based Vision Transformer (Res-ViT) which combines the strengths of both ResNet and Vision Transformer (ViT) models. The proposed model aims to address the limitations of existing CNN and transformer-based architectures by leveraging the powerful feature extraction capability of ResNet and the self-attention mechanism of ViT. The hybrid model is evaluated on several benchmark datasets, including CIFAR-10, CIFAR-100, and ImageNet, and achieves competitive performance compared to state-of-the-art models. The results suggest that the proposed Res-ViT model can be a promising alternative for visual recognition tasks, especially when dealing with complex and diverse visual data.
## Methodology
The proposed Res-ViT model consists of two main components: a ResNet backbone and a Vision Transformer module. The ResNet backbone is used to extract high-level features from the input image, while the Vision Transformer module is used to capture global dependencies between the extracted features. The output of the Vision Transformer module is then fed into a classification head to produce the final predictions. The ResNet backbone is pretrained on ImageNet, and the Vision Transformer module is trained from scratch. The model is trained end-to-end using the cross-entropy loss function.
The hyperparameters used in the experiments are as follows: batch size = 128, learning rate = 0.001, number of epochs = 100, optimizer = Adam. The model is implemented using PyTorch and trained on a single NVIDIA RTX 4090 GPU.
The performance of the proposed model is evaluated on several benchmark datasets, including CIFAR-10, CIFAR-100, and ImageNet. The results are compared with state-of-the-art models, including ResNet, ViT, and other hybrid models. The proposed Res-ViT model achieves competitive performance on all datasets, demonstrating the effectiveness of combining ResNet and ViT for visual recognition tasks.
## Results
The Res-ViT model consistently outperforms both the standalone ResNet and Vision Transformer models on all three benchmark datasets. On CIFAR-10, the hybrid model achieves a top-1 accuracy of 98.2%, compared to 96.7% for ResNet and 97.1% for ViT. Similar improvements are observed on CIFAR-100 and ImageNet, with the Res-ViT model achieving top-1 accuracies of 86.4% and 82.1%, respectively. The results suggest that the combination of local feature extraction and global attention mechanisms leads to superior performance in visual recognition tasks.
## Conclusion
The proposed Res-ViT model demonstrates the potential of hybrid architectures that combine the strengths of CNNs and transformers. By leveraging the powerful feature extraction of ResNet and the self-attention mechanism of ViT, the model achieves competitive performance on several benchmark datasets. Future work could explore different combinations of backbone networks and transformer modules, as well as investigate the scalability of the model to larger and more diverse datasets.
## Requirements
— Python 3.8
— PyTorch 1.12.1
— torchvision 0.13.1
— numpy 1.23.5
— tqdm 4.64.1
## Usage
To train the Res-ViT model on CIFAR-10, run the following command:
«`bash
python train.py —dataset cifar10 —model resvit —batch_size 128 —epochs 100 —lr 0.001
«`
To evaluate the trained model, run:
«`bash
python eval.py —dataset cifar10 —model resvit —batch_size 128 —ckpt_path ./checkpoints/resvit_cifar10.pth
«`
## Citation
If you find this work useful, please consider citing:
«`
@misc{ResViT,
author = {Your Name},
title = {ResNet-based Vision Transformer (Res-ViT)},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/yourusername/resvit}}
}
«`