repo
stringlengths
1
99
file
stringlengths
13
215
code
stringlengths
12
59.2M
file_length
int64
12
59.2M
avg_line_length
float64
3.82
1.48M
max_line_length
int64
12
2.51M
extension_type
stringclasses
1 value
rlgraph
rlgraph-master/rlgraph/components/distributions/mixture_distribution.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
4,123
39.431373
115
py
rlgraph
rlgraph-master/rlgraph/components/distributions/bernoulli.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
1,961
36.730769
110
py
rlgraph
rlgraph-master/rlgraph/components/policies/policy.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
26,045
48.801147
120
py
rlgraph
rlgraph-master/rlgraph/components/policies/dueling_policy.py
# Copyright 2018/2019 The Rlgraph Authors, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
10,112
43.161572
113
py
rlgraph
rlgraph-master/rlgraph/components/common/synchronizable.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
6,614
49.113636
120
py
rlgraph
rlgraph-master/rlgraph/components/common/time_dependent_parameters.py
# Copyright 2018/2019 The Rlgraph Authors, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
11,207
42.274131
118
py
rlgraph
rlgraph-master/rlgraph/components/common/softmax.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,511
35.405797
104
py
rlgraph
rlgraph-master/rlgraph/components/common/decay_components.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
11,824
41.689531
120
py
rlgraph
rlgraph-master/rlgraph/components/common/container_merger.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
4,741
42.109091
112
py
rlgraph
rlgraph-master/rlgraph/components/helpers/sequence_helper.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
16,966
41.52381
117
py
rlgraph
rlgraph-master/rlgraph/components/helpers/clipping.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
1,992
32.779661
110
py
rlgraph
rlgraph-master/rlgraph/components/action_adapters/bernoulli_distribution_adapter.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,099
34.59322
113
py
rlgraph
rlgraph-master/rlgraph/components/action_adapters/beta_distribution_adapter.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,734
40.966292
112
py
rlgraph
rlgraph-master/rlgraph/components/action_adapters/squashed_normal_distribution_adapter.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,347
39.829268
112
py
rlgraph
rlgraph-master/rlgraph/components/action_adapters/categorical_distribution_adapter.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,686
36.319444
98
py
rlgraph
rlgraph-master/rlgraph/components/action_adapters/normal_distribution_adapter.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,446
38.62069
112
py
rlgraph
rlgraph-master/rlgraph/components/action_adapters/gumbel_softmax_distribution_adapter.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,144
34.163934
91
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/lstm_layer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
12,456
50.475207
119
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/local_response_normalization_layer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,060
41.513889
119
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/conv2d_transpose_layer.py
# Copyright 2018/2019 ducandu GmbH, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
6,127
46.503876
116
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/maxpool2d_layer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,088
42.507042
119
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/dense_layer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
5,326
45.321739
108
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/multi_lstm_layer.py
# Copyright 2018/2019 ducandu GmbH, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
11,866
53.43578
173
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/conv2d_layer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
6,463
45.503597
116
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/activation_functions.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
5,289
39.692308
107
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/nn_layer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
7,070
44.619355
117
py
rlgraph
rlgraph-master/rlgraph/components/layers/nn/concat_layer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
4,110
42.273684
112
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/concat.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,581
43.222222
116
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/grayscale.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
6,200
41.472603
120
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/sequence.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
11,865
45.351563
119
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/moving_standardize.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
5,760
40.15
119
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/reshape.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
16,442
51.03481
120
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/transpose.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,825
41.511111
114
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/convert_type.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
5,430
46.226087
114
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/image_resize.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
6,930
39.296512
115
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/normalize.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,955
40.055556
119
py
rlgraph
rlgraph-master/rlgraph/components/layers/preprocessing/image_crop.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
4,423
38.855856
109
py
rlgraph
rlgraph-master/rlgraph/components/explorations/epsilon_exploration.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
4,673
43.514286
119
py
rlgraph
rlgraph-master/rlgraph/components/explorations/exploration.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
8,725
43.520408
119
py
rlgraph
rlgraph-master/rlgraph/components/optimizers/horovod_optimizer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,813
40.382353
115
py
rlgraph
rlgraph-master/rlgraph/components/optimizers/local_optimizers.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
12,369
38.269841
119
py
rlgraph
rlgraph-master/rlgraph/components/memories/replay_memory.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
5,548
41.684615
120
py
rlgraph
rlgraph-master/rlgraph/components/memories/ring_buffer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
12,829
48.157088
127
py
rlgraph
rlgraph-master/rlgraph/components/memories/__init__.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,283
38.37931
83
py
rlgraph
rlgraph-master/rlgraph/components/memories/mem_prioritized_replay.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
6,065
39.44
107
py
rlgraph
rlgraph-master/rlgraph/components/loss_functions/ppo_loss_function.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
9,496
44.658654
127
py
rlgraph
rlgraph-master/rlgraph/components/loss_functions/dqn_loss_function.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
16,189
49.123839
119
py
rlgraph
rlgraph-master/rlgraph/components/loss_functions/actor_critic_loss_function.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
7,015
42.042945
119
py
rlgraph
rlgraph-master/rlgraph/components/loss_functions/loss_function.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,853
35.704762
114
py
rlgraph
rlgraph-master/rlgraph/graphs/graph_builder.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
70,001
54.076318
125
py
rlgraph
rlgraph-master/rlgraph/graphs/pytorch_executor.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
8,737
38.538462
106
py
rlgraph
rlgraph-master/rlgraph/graphs/__init__.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
1,755
34.836735
88
py
rlgraph
rlgraph-master/rlgraph/utils/pytorch_util.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
5,297
31.906832
119
py
rlgraph
rlgraph-master/rlgraph/utils/input_parsing.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
11,333
38.082759
122
py
rlgraph
rlgraph-master/rlgraph/utils/util.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
14,894
34.805288
120
py
rlgraph
rlgraph-master/rlgraph/utils/__init__.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,379
55.666667
118
py
rlgraph
rlgraph-master/rlgraph/utils/initializer.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
4,467
45.541667
119
py
rlgraph
rlgraph-master/rlgraph/utils/define_by_run_ops.py
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
16,344
40.484772
134
py
citygan
citygan-master/model/datafolder.py
import torch.utils.data as data from PIL import Image import os import os.path import cPickle as pickle import gzip from scipy.ndimage.interpolation import rotate from skimage.io import imread from skimage.transform import resize import numpy as np IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.tif', '.TI...
6,514
33.109948
111
py
citygan
citygan-master/model/main.py
import torch from trainer import Trainer from config import get_config from data_loader import get_loader from utils import prepare_dirs_and_logger, save_config # Mean [0.03400000184774399, 164.42999267578125, 1.3049999475479126, 0.8849999904632568, 0.08799999952316284] # Stdv [0.16899999976158142, 1040.2120361328125...
2,292
34.276923
316
py
citygan
citygan-master/model/data_loader.py
import os import numpy as np from glob import glob from PIL import Image from tqdm import tqdm import torch from torchvision import transforms import torchvision.datasets as dset from folder import ImageFolder from datafolder import DataFolder, rotate_ndimage, attributes_loader, ndimage_loader, basic_preprocess, flip...
3,207
46.176471
246
py
citygan
citygan-master/model/models_dcgan.py
import torch import numpy as np from torch import nn import torch.nn.functional as F from torch.autograd import Variable from torch.utils.data import TensorDataset, DataLoader def weights_init(m): classname = m.__class__.__name__ if classname.find('Conv') != -1: m.weight.data.normal_(0.0, 0.02) eli...
5,730
35.503185
88
py
citygan
citygan-master/model/train_dcgan.py
from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torchvision.transforms as transforms import torchv...
10,260
38.617761
298
py
citygan
citygan-master/model/folder.py
import torch.utils.data as data from PIL import Image import os import os.path IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.tif', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', ] def is_image_file(filename): return any(filename.endswith(extension) for extension in IMG_EXTENSIONS) def make_dat...
1,664
27.706897
94
py
FedMA
FedMA-master/main.py
from utils import * import pickle import copy from sklearn.preprocessing import normalize from matching.pfnm import layer_wise_group_descent from matching.pfnm import block_patching, patch_weights from matching.gaus_marginal_matching import match_local_atoms from combine_nets import compute_pdm_matching_multilayer, c...
85,875
50.701385
169
py
FedMA
FedMA-master/vgg.py
''' Modified from https://github.com/pytorch/vision.git ''' import math import torch.nn as nn import torch.nn.init as init __all__ = [ 'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn', 'vgg19_bn', 'vgg19', ] class VGG(nn.Module): ''' VGG model ''' def __init__(self, feat...
6,246
32.228723
135
py
FedMA
FedMA-master/matching_performance.py
import logging from model import * from utils import * from vgg import * from vgg import matched_vgg11 def compute_model_averaging_accuracy(models, weights, train_dl, test_dl, n_classes, args): """An variant of fedaveraging""" if args.model == "lenet": avg_cnn = LeNet() elif args.model == "vgg": ...
13,783
44.491749
149
py
FedMA
FedMA-master/utils.py
import os import argparse import json import numpy as np import torch import torch.optim as optim import torch.nn as nn import logging import torchvision import torchvision.transforms as transforms import torch.utils.data as data from itertools import product import math import copy import time from sklearn.metrics imp...
58,737
44.960876
186
py
FedMA
FedMA-master/model.py
import torch import torch.nn as nn import torch.nn.functional as F class FcNet(nn.Module): """ Fully connected network for MNIST classification """ def __init__(self, input_dim, hidden_dims, output_dim, dropout_p=0.0): super().__init__() self.input_dim = input_dim self.hidden...
14,667
33.111628
115
py
FedMA
FedMA-master/datasets.py
import torch.utils.data as data from PIL import Image import numpy as np from torchvision.datasets import MNIST, CIFAR10 from torchvision.datasets import DatasetFolder from PIL import Image import os import os.path import sys import logging logging.basicConfig() logger = logging.getLogger() logger.setLevel(logging.I...
14,275
31.743119
144
py
FedMA
FedMA-master/dist_skew_main.py
from utils import * import pickle import copy from sklearn.preprocessing import normalize #from matching.pfnm import layer_group_descent from matching.pfnm import layer_wise_group_descent, layer_wise_group_descent_comm from matching.pfnm import block_patching, patch_weights from matching.utils import ModerateCNNContai...
68,404
50.548606
184
py
FedMA
FedMA-master/combine_nets.py
import torch import torch.nn.functional as F import numpy as np import logging #from matching.pfnm import layer_group_descent as pdm_multilayer_group_descent from matching.pfnm_communication import layer_group_descent as pdm_iterative_layer_group_descent from matching.pfnm_communication import build_init as pdm_build_...
12,022
35.213855
138
py
FedMA
FedMA-master/language_modeling/gaus_marginal_matching.py
import numpy as np from lapsolver import solve_dense import logging import torch import time logging.basicConfig() logger = logging.getLogger() logger.setLevel(logging.INFO) def compute_cost(global_atoms, atoms_j, global_atoms_squared, sigma, sigma0, mu0, popularity_counts, gamma, J): Lj = atoms_j.shap...
8,773
46.945355
199
py
FedMA
FedMA-master/language_modeling/ensemble_accuracy_calculator.py
# part of the code blocks are modified from: # https://github.com/litian96/FedProx/blob/master/flearn/models/shakespeare/stacked_lstm.py # by Hongyi Wang (hwang595 @ GitHub) # credit goes to: Tian Li (litian96 @ GitHub) import json import logging import numpy as np import time import math import pickle import copy f...
21,535
38.227687
205
py
FedMA
FedMA-master/language_modeling/lstm_fedma_with_comm.py
# part of the code blocks are modified from: https://github.com/litian96/FedProx/blob/master/flearn/models/shakespeare/stacked_lstm.py # credit goes to: Tian Li (litian96 @ GitHub) import json import logging import numpy as np import time import math import pickle import copy import torch import torch.nn as nn import...
27,506
51.796545
238
py
FedMA
FedMA-master/language_modeling/language_oneshot_matching.py
# part of the code blocks are modified from: https://github.com/litian96/FedProx/blob/master/flearn/models/shakespeare/stacked_lstm.py # credit goes to: Tian Li (litian96 @ GitHub) import json import logging import numpy as np import time import math import pickle import copy import torch import torch.nn as nn import ...
32,638
53.671692
256
py
FedMA
FedMA-master/language_modeling/language_main.py
# part of the code blocks are modified from: https://github.com/litian96/FedProx/blob/master/flearn/models/shakespeare/stacked_lstm.py # credit goes to: Tian Li (litian96 @ GitHub) import json import logging import numpy as np import time import math import pickle import copy import argparse import torch import torch...
39,821
54.851332
257
py
FedMA
FedMA-master/language_modeling/language_utils.py
# Modified from: https://github.com/litian96/FedProx/blob/master/flearn/utils/language_utils.py # credit goes to: Tian Li (litian96 @ GitHub) """Utils for language models.""" import re import numpy as np import torch # ------------------------ # utils for shakespeare dataset ALL_LETTERS = "\n !\"&'(),-.0123456789:...
6,444
30.905941
102
py
FedMA
FedMA-master/language_modeling/language_model.py
import logging import math import torch import torch.nn as nn import torch.nn.functional as F logging.basicConfig() logger = logging.getLogger() logger.setLevel(logging.INFO) class RNNModel(nn.Module): """ Container module with an encoder, a recurrent module, and a decoder. Modified by: Hongyi Wang from ...
5,664
38.615385
125
py
FedMA
FedMA-master/language_modeling/language_whole_training.py
# part of the code blocks are modified from: https://github.com/litian96/FedProx/blob/master/flearn/models/shakespeare/stacked_lstm.py # credit goes to: Tian Li (litian96 @ GitHub) import json import logging import numpy as np import time import math import pickle import copy import torch import torch.nn as nn import...
6,131
37.325
209
py
FedMA
FedMA-master/jupyter_notebook/matching/utils.py
import logging import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from scipy.optimize import linear_sum_assignment #from lapsolver import solve_dense logging.basicConfig() logger = logging.getLogger() logger.setLevel(logging.INFO) class SimpleCNNContainerConvBlocks(nn.Module): ...
4,092
38.737864
105
py
FedMA
FedMA-master/jupyter_notebook/matching/pfnm.py
from .utils import * from .gaus_marginal_matching import match_local_atoms import copy def row_param_cost(global_weights, weights_j_l, global_sigmas, sigma_inv_j): match_norms = ((weights_j_l + global_weights) ** 2 / (sigma_inv_j + global_sigmas)).sum(axis=1) - ( global_weights ** 2 / global_sigma...
69,052
61.153915
226
py
FedMA
FedMA-master/jupyter_notebook/matching/.ipynb_checkpoints/pfnm-checkpoint.py
from .utils import * import copy def row_param_cost(global_weights, weights_j_l, global_sigmas, sigma_inv_j): match_norms = ((weights_j_l + global_weights) ** 2 / (sigma_inv_j + global_sigmas)).sum(axis=1) - ( global_weights ** 2 / global_sigmas).sum(axis=1) return match_norms def compute_c...
54,041
59.721348
226
py
FedMA
FedMA-master/jupyter_notebook/matching/.ipynb_checkpoints/utils-checkpoint.py
import logging import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from scipy.optimize import linear_sum_assignment #from lapsolver import solve_dense logging.basicConfig() logger = logging.getLogger() logger.setLevel(logging.INFO) class SimpleCNNContainerConvBlocks(nn.Module): ...
4,092
38.737864
105
py
FedMA
FedMA-master/matching/gaus_marginal_matching.py
import numpy as np from .utils import * from lapsolver import solve_dense import torch def compute_cost(global_atoms, atoms_j, global_atoms_squared, sigma, sigma0, mu0, popularity_counts, gamma, J): Lj = atoms_j.shape[0] counts = np.array(popularity_counts).astype(np.float32) sigma_ratio = (sigm...
8,957
48.491713
199
py
FedMA
FedMA-master/matching/utils.py
import logging import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from scipy.optimize import linear_sum_assignment from lapsolver import solve_dense import time logging.basicConfig() logger = logging.getLogger() logger.setLevel(logging.INFO) class SimpleCNNContainerConvBlocks(nn....
4,600
37.341667
105
py
FedMA
FedMA-master/matching/pfnm.py
from .utils import * import copy #from joblib import Parallel, delayed from .gaus_marginal_matching import match_local_atoms import torch # atoms_j_cuda = torch.from_numpy(atoms_j).to('cuda:0') # global_atoms_cuda = torch.from_numpy(global_atoms).to('cuda:0') # denum_match_cuda = torch.from_numpy(denum_match).to('cud...
121,897
58.753922
236
py
GWNN
GWNN-master/GraphWaveletNetwork/layers.py
from inits import * import tensorflow as tf from sklearn.preprocessing import normalize flags = tf.app.flags FLAGS = flags.FLAGS # global unique layer ID dictionary for layer name assignment _LAYER_UIDS = {} def get_layer_uid(layer_name=''): """Helper function, assigns unique layer IDs.""" if layer_name not ...
13,487
34.125
136
py
FACIL
FACIL-master/src/last_layer_analysis.py
import torch import matplotlib import numpy as np import matplotlib.pyplot as plt matplotlib.use('Agg') def last_layer_analysis(heads, task, taskcla, y_lim=False, sort_weights=False): """Plot last layer weight and bias analysis""" print('Plotting last layer analysis...') num_classes = sum([x for (_, x) in...
2,533
39.870968
122
py
FACIL
FACIL-master/src/utils.py
import os import torch import random import numpy as np cudnn_deterministic = True def seed_everything(seed=0): """Fix all random seeds""" random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed_all(seed) os.environ['PYTHONHASHSEED'] = str(seed) torch.backend...
1,111
30.771429
116
py
FACIL
FACIL-master/src/main_incremental.py
import os import time import torch import argparse import importlib import numpy as np from functools import reduce import utils import approach from loggers.exp_logger import MultiLogger from datasets.data_loader import get_loaders from datasets.dataset_config import dataset_config from last_layer_analysis import las...
17,238
53.381703
120
py
FACIL
FACIL-master/src/networks/network.py
import torch from torch import nn from copy import deepcopy class LLL_Net(nn.Module): """Basic class for implementing networks""" def __init__(self, model, remove_existing_head=False): head_var = model.head_var assert type(head_var) == str assert not remove_existing_head or hasattr(mo...
3,664
37.177083
118
py
FACIL
FACIL-master/src/networks/vggnet.py
from torch import nn import torch.nn.functional as F class VggNet(nn.Module): """ Following the VGGnet based on VGG16 but for smaller input (64x64) Check this blog for some info: https://learningai.io/projects/2017/06/29/tiny-imagenet.html """ def __init__(self, num_classes=1000): super()...
2,322
38.372881
116
py
FACIL
FACIL-master/src/networks/resnet32.py
import torch.nn as nn __all__ = ['resnet32'] def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) class BasicBlock(nn.Module): expansion = 1 def __init__(self, inplanes, planes,...
4,245
35.603448
116
py
FACIL
FACIL-master/src/networks/lenet.py
from torch import nn import torch.nn.functional as F class LeNetArch(nn.Module): """LeNet-like network for tests with MNIST (28x28).""" def __init__(self, in_channels=1, num_classes=10, **kwargs): super().__init__() # main part of the network self.conv1 = nn.Conv2d(in_channels, 6, 5) ...
1,159
30.351351
116
py
FACIL
FACIL-master/src/networks/__init__.py
from torchvision import models from .lenet import LeNet from .vggnet import VggNet from .resnet32 import resnet32 # available torchvision models tvmodels = ['alexnet', 'densenet121', 'densenet169', 'densenet201', 'densenet161', 'googlenet', 'inception_v3', 'mobilenet_v2...
1,558
34.431818
112
py
FACIL
FACIL-master/src/loggers/tensorboard_logger.py
from torch.utils.tensorboard import SummaryWriter from loggers.exp_logger import ExperimentLogger import json import numpy as np class Logger(ExperimentLogger): """Characterizes a Tensorboard logger""" def __init__(self, log_path, exp_name, begin_time=None): super(Logger, self).__init__(log_path, ex...
1,883
34.54717
79
py
FACIL
FACIL-master/src/loggers/disk_logger.py
import os import sys import json import torch import numpy as np from datetime import datetime from loggers.exp_logger import ExperimentLogger class Logger(ExperimentLogger): """Characterizes a disk logger""" def __init__(self, log_path, exp_name, begin_time=None): super(Logger, self).__init__(log_p...
2,837
36.342105
120
py
FACIL
FACIL-master/src/datasets/data_loader.py
import os import numpy as np from torch.utils import data import torchvision.transforms as transforms from torchvision.datasets import MNIST as TorchVisionMNIST from torchvision.datasets import CIFAR100 as TorchVisionCIFAR100 from torchvision.datasets import SVHN as TorchVisionSVHN from . import base_dataset as baseda...
9,957
48.79
120
py
FACIL
FACIL-master/src/datasets/base_dataset.py
import os import random import numpy as np from PIL import Image from torch.utils.data import Dataset class BaseDataset(Dataset): """Characterizes a dataset for PyTorch -- this dataset pre-loads all paths in memory""" def __init__(self, data, transform, class_indices=None): """Initialization""" ...
4,882
36.852713
112
py