id
int64 0
458k
| file_name
stringlengths 4
119
| file_path
stringlengths 14
227
| content
stringlengths 24
9.96M
| size
int64 24
9.96M
| language
stringclasses 1
value | extension
stringclasses 14
values | total_lines
int64 1
219k
| avg_line_length
float64 2.52
4.63M
| max_line_length
int64 5
9.91M
| alphanum_fraction
float64 0
1
| repo_name
stringlengths 7
101
| repo_stars
int64 100
139k
| repo_forks
int64 0
26.4k
| repo_open_issues
int64 0
2.27k
| repo_license
stringclasses 12
values | repo_extraction_date
stringclasses 433
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,286,700 | clientamppt.cpython-38.pyc | hkgdifyu_pFedPT/system/flcore/clients/__pycache__/clientamppt.cpython-38.pyc | U
#ôıc‰ ã @ st d dl Z d dlmZ d dlmZ d dlZd dlZd dlZd dlZd dl m
Z
d dlmZ G dd„ deƒZ
dd„ ZdS ) é N)ÚClient)Úlabel_binarize)Úmetricsc s4 e Zd Z‡ fdd„Zdd„ Zdd„ Zdd„ Z‡ ZS ) ÚclientAMPPTc s¦ t ƒ j||||f|� |j| _|j| _t | j¡| _t ¡ | _
tj
| jj ¡ | jdœg¡| _|j| _tjj
| jj ¡ |j|jd�| _tjjj| j| j|jd�| _d S )N)ÚparamsÚlr)r Úmomentum)Ú step_sizeÚgamma)ÚsuperÚ__init__ÚalphaKÚlamdaÚcopyÚdeepcopyÚmodelÚclient_uÚnnÚCrossEntropyLossÚlossÚtorchÚoptimÚSGDÚbaseÚ
parametersÚ
learning_rateÚ optimizerÚplocal_stepsÚ generatorÚpt_learning_rater Ú
poptimizerÚlr_schedulerÚStepLRÚlearning_decayÚ scheduler)ÚselfÚargsÚidÚ
train_samplesÚtest_samplesÚkwargs©Ú __class__© õY D:\京东\promot\第二次投稿\å®�验\native - pro\system\flcore\clients\clientamppt.pyr s
ÿÿÿzclientAMPPT.__init__c C s | ¡ }t ¡ }t | jj¡}| j | j¡ | j | j¡ | j ¡ | jj
¡ D ]
}d|_qP| jj ¡ D ]
}d|_qht
| jƒD ]´}t|ƒD ]¦\}\}}t|ƒtg ƒkr¼|d | j¡|d< |