Horizontal VGG
Introduction
Horizontal VGG model is a model obtained by building the classic model VGG proposed in the paper “Very Deep Convolutional Networks for Large-Scale Image Recognition” on the horizontal federation system, and is implemented based on the deep learning framework.
Parameter List
identity: str Federated identity of the party, should be one of label_trainer, trainer or assist trainer.
- model_info:
name:
strModel name, should be horizontal_vgg.- config:
num_classes:
intNumber of output classes.layers:
intVGG layers(11,13,16,19), support VGG11, VGG13, VGG16, VGG19.
- input:
- trainset:
type:
strTrain dataset type, support csv.path:
strIf type is csv, folder path of train dataset.name:
boolIf type is csv, file name of train dataset.has_id:
boolIf type is csv, whether dataset has id column.has_label:
boolIf type is csv, whether dataset has label column.
- valset:
type:
strValidation dataset type, support csv.path:
strIf type is csv, folder path of validation dataset.name:
boolIf type is csv, file name of validation dataset.has_id:
boolIf type is csv, whether dataset has id column.has_label:
boolIf type is csv, whether dataset has label column.
- output:
- model:
type:
strModel output format, support “file”.path:
strFolder path of output model.name:
strFile name of output model.
- train_info:
device:
strDevice on which the algorithm runs, support cpu and specified gpu device such as cuda:0.- params:
global_epoch:
intGlobal training epoch.local_epoch:
intLocal training epoch of involved parties.batch_size:
intBatch size of samples in local and global process.- aggregation_config:
type:
strAggregation method, support “fedavg”.- encryption:
method:
strEncryption method, recommend “otp”.key_bitlength:
intKey length of one time pad encryption, support 64 and 128.data_type:
strInput data type, support torch.Tensor and numpy.ndarray, depending on model data type.- key_exchange:
key_bitlength:
intBitlength of paillier key, recommend to be greater than or equal to 2048.optimized:
boolWhether to use optimized method.
- csprng:
name:
strPseudo-random number generation method.method:
strCorresponding hash method.
- optimizer_config: Support optimizers and their parameters defined in pytorch or registered by user. For example:
- Adam:
lr:
floatOptimizer earning rate.amsgrad:
boolWhether to use the AMSGrad variant.
- lr_scheduler_config: Support lr_scheduler and their parameters defined in pytorch or registered by user. For example:
- StepLR:
step_size:
intPeriod of learning rate decay.gamma:
floatMultiplicative factor of learning rate decay.
lossfunc_config: Loss function configuration, support CrossEntropyLoss.
- metric_config: Support multiple metrics.
accuracy: Accuracy.
precision: Precision.
recall: Recall.
f1_score: F1 score.