EXP_NAME = "ImageNet100"
IMAGE_SIZE = 168
NUM_FEATURES = 3 * IMAGE_SIZE * IMAGE_SIZE
NUM_CLASSES = 100
NUM_TRAIN_DATA = 129395
NUM_TEST_DATA = 5000

acc_sign = 0.03
save_for_split = [0.61]

n1 = 2
n2 = 2
n3 = 2
n4 = 4
download_speed = 20
upload_speed = 5


holistic_coeff = 10

min_density = 0.02

NUM_CLIENTS = 10
NUM_LOCAL_UPDATES = 5
CLIENT_BATCH_SIZE = 20
INIT_LR = 0.05
MOMENTUM = 0.9
WEIGHT_DECAY = 1e-4

EVAL_DISP_INTERVAL = 200
ADJ_INTERVAL = 50
SAVE_INTERVAL = 50

IP_MAX_ROUNDS = 1000
IP_ADJ_INTERVAL = ADJ_INTERVAL
IP_DATA_BATCH = 25
IP_THR = 0.1

# Resnet18
DENSE_TIME = 25.3356386726
SPARSE_ALL_TIME = 27.966371
SPARSE1_TIME = 14.560097051459854
COEFFICIENTS_SINGLE = [0.0, 2.340521716080689e-06, 1.0023681746470196e-05, 1.056062089141079e-05, 4.237937059382076e-06,
                       5.6712687899939165e-06, 2.1231460738533592e-06, 2.3287953360690104e-06, 6.735456426708777e-07,
                       6.624979740735464e-06, 5.137498356286562e-07, 1.9743886037025985e-07, 3.703237561077147e-08,
                       9.910993133200227e-07, 1.4966532573161931e-06, 7.477319510700925e-07, 8.722523120339614e-07,
                       6.128180224224039e-06]

SPARSE_TIME = SPARSE1_TIME - sum(COEFFICIENTS_SINGLE)

COMP_COEFFICIENTS = [c * NUM_LOCAL_UPDATES for c in COEFFICIENTS_SINGLE]
# 1MBps = 4e-6 * 2
COMM_COEFFICIENT = 5.561621025626998e-06
TIME_CONSTANT = SPARSE_TIME * NUM_LOCAL_UPDATES

ADJ_THR_FACTOR = 1.5
ADJ_THR_ACC = ADJ_THR_FACTOR / NUM_CLASSES

# Variablespatience = 8

MAX_INC_DIFF = None
MAX_DEC_DIFF = 0.3

LR_HALF_LIFE = 10000
STEP_SIZE = 2000
ADJ_HALF_LIFE = 10000
test_num = 1
train_num = 1
patience = 5

asyn_interval = 0.5
MAX_TIME_PMT = 50000
MAX_ROUND = 20001
MAX_TIME = 320000
adaptive_ROUND = 5000

# Iterative pruning config
NUM_ITERATIVE_PRUNING = 20
PMT_ACC=[0.1,0.2,0.3,0.4,0.5,0.6,0.61,0.62,0.63,0.64,0.65,0.66,0.67,0.68,0.69]
# Online algorithm config
MAX_NUM_UPLOAD = 5
model_size = 43.1007
