|
|
|
|
|
|
|
|
import torch |
|
|
import torch |
|
|
from transformers import BertTokenizer, BertModel, BertConfig |
|
|
|
|
|
|
|
|
|
|
|
from data.config import Config |
|
|
from data.config import Config |
|
|
from data.weibo.data_loader import WeiboDatasetLoader |
|
|
from data.weibo.data_loader import WeiboDatasetLoader |
|
|
|
|
|
|
|
|
batch_size = 100 |
|
|
batch_size = 100 |
|
|
epochs = 100 |
|
|
epochs = 100 |
|
|
num_workers = 1 |
|
|
num_workers = 1 |
|
|
head_lr = 1e-03 |
|
|
|
|
|
image_encoder_lr = 1e-02 |
|
|
|
|
|
text_encoder_lr = 1e-05 |
|
|
|
|
|
weight_decay = 0.001 |
|
|
|
|
|
classification_lr = 1e-02 |
|
|
|
|
|
|
|
|
head_lr = 0.0085 |
|
|
|
|
|
image_encoder_lr = 1.0e-05 |
|
|
|
|
|
text_encoder_lr = 0.00016 |
|
|
|
|
|
weight_decay = 0.00015 |
|
|
|
|
|
classification_lr = 0.00149 |
|
|
|
|
|
|
|
|
device = torch.device("cuda:1" if torch.cuda.is_available() else "cpu") |
|
|
|
|
|
|
|
|
hidden_size = 128 |
|
|
|
|
|
projection_size = 64 |
|
|
|
|
|
dropout = 0.5 |
|
|
|
|
|
|
|
|
|
|
|
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") |
|
|
|
|
|
|
|
|
image_model_name = '../../../../../media/external_10TB/10TB/ghorbanpoor/vit-base-patch16-224' |
|
|
image_model_name = '../../../../../media/external_10TB/10TB/ghorbanpoor/vit-base-patch16-224' |
|
|
image_embedding = 768 |
|
|
image_embedding = 768 |
|
|
text_encoder_model = "../../../../../media/external_10TB/10TB/ghorbanpoor/xlnet-base-chinese" |
|
|
|
|
|
|
|
|
text_encoder_model = "../../../../../media/external_10TB/10TB/ghorbanpoor/bert-base-chinese" |
|
|
# text_encoder_model = "/home/faeze/PycharmProjects/new_fake_news_detectioin/bert/bert-base-uncased" |
|
|
# text_encoder_model = "/home/faeze/PycharmProjects/new_fake_news_detectioin/bert/bert-base-uncased" |
|
|
text_tokenizer = "../../../../../media/external_10TB/10TB/ghorbanpoor/xlnet-base-chinese" |
|
|
|
|
|
|
|
|
text_tokenizer = "../../../../../media/external_10TB/10TB/ghorbanpoor/bert-base-chinese" |
|
|
# text_tokenizer = "/home/faeze/PycharmProjects/new_fake_news_detectioin/bert/bert-base-uncased" |
|
|
# text_tokenizer = "/home/faeze/PycharmProjects/new_fake_news_detectioin/bert/bert-base-uncased" |
|
|
text_embedding = 768 |
|
|
text_embedding = 768 |
|
|
max_length = 200 |
|
|
max_length = 200 |