forked from GYan58/KDD-2023-CriticalFL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.py
40 lines (34 loc) · 892 Bytes
/
Settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
import numpy as np
import copy as cp
import random as rd
seed = 1234
np.random.seed(seed)
rd.seed(seed)
import torch
import torch.nn as nn
import gc
import time
import math
from collections import OrderedDict
import argparse
import torchvision
import torchvision.transforms as transforms
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader
from PIL import Image, ImageFilter
from os.path import join
import torch
import torch.utils.data as data
import torchvision.datasets as datasets
from Comp_FIM.object import PMatKFAC, PMatEKFAC, PMatDiag, PMatDense
from Comp_FIM.metrics import FIM, FIM_MonteCarlo
from Comp_FIM.object.vector import random_pvector, PVector
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
## Configurations:
device = "cuda"
BaseRoot = "//"
ShakeRoot = "//"
Symbol = "//"