faknow.model
- faknow.model.content_based
- faknow.model.content_based.multi_modal
- faknow.model.content_based.multi_modal.cafe
- faknow.model.content_based.multi_modal.eann
- faknow.model.content_based.multi_modal.hmcan
- faknow.model.content_based.multi_modal.mcan
- faknow.model.content_based.multi_modal.mfan
- faknow.model.content_based.multi_modal.safe
- faknow.model.content_based.multi_modal.spotfake
- faknow.model.content_based.endef
- faknow.model.content_based.m3fend
- faknow.model.content_based.mdfend
- faknow.model.content_based.textcnn
- faknow.model.content_based.multi_modal
- faknow.model.layers
- faknow.model.layers.dct
- faknow.model.layers.layer
- faknow.model.layers.layers_m3fend
- faknow.model.layers.transformer
- faknow.model.social_context
- faknow.model.social_context.base_gnn
- faknow.model.social_context.bigcn
- faknow.model.social_context.dudef
- faknow.model.social_context.ebgcn
- faknow.model.social_context.eddfn
- faknow.model.social_context.fang
- faknow.model.social_context.gcnfn
- faknow.model.social_context.gnncl
- faknow.model.social_context.trustrd
- faknow.model.social_context.upfd
faknow.model.model
- class faknow.model.model.AbstractModel[source]
Bases:
Module
abstract class for all models, every model should inherit it and implement the following methods: 1. calculate_loss 2. predict
- calculate_loss(data) Tensor | Dict[str, Tensor] [source]
calculate loss
- Parameters:
data – batch data
- Returns:
loss or a dict of loss if there are multiple losses
- Return type:
Union[Tensor, Dict[str, Tensor]]
- predict(data_without_label) Tensor [source]
predict the probability of being fake news
- Parameters:
data_without_label – batch data
- Returns:
probability, shape=(batch_size, 2)
- Return type:
Tensor
- training: bool