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
EntityDescriptionGeneration
EntityDescriptionGeneration-master/test/unit/test_init_embedding.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
1,170
34.484848
78
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/test/unit/test_optimizers.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
1,894
38.479167
109
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/test/unit/test_attention.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
18,423
50.898592
123
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/test/unit/test_data_io.py
# Copyright 2017, 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
34,870
45.494667
119
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/test/unit/test_utils.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
16,748
38.409412
118
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/test/unit/image_captioning/test_encoder.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
3,444
43.74026
88
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/test/unit/image_captioning/test_arguments.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
3,488
37.766667
106
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/test/unit/image_captioning/test_data_io.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
15,939
56.963636
142
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/test/integration/test_seq_copy_int.py
# Copyright 2017, 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
17,215
54.003195
126
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/init_embedding.py
#!/usr/bin/env python3 # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or i...
6,618
38.634731
104
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/inference.py
# Copyright 2017--2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
138,876
51.925686
170
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/scoring.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
13,427
44.060403
136
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/gcn_att.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, direction_num...
7,911
36.67619
123
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/average.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
6,123
33.59887
117
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/multiprocessing_utils.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
2,981
39.297297
120
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/constants.py
# Copyright 2017--2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
16,550
32.777551
148
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/deep_gcn_cnn.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, direction_num...
11,287
42.415385
154
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/gcn_avg.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, direction_num...
10,605
41.766129
154
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/lexicon.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
11,079
40.189591
118
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/deepgcn.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, direction_num...
10,594
41.721774
132
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/lightweight_gcn.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, directions=co...
10,180
39.561753
135
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/checkpoint_decoder.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
10,132
48.18932
134
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/optimizers.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
11,776
41.060714
110
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/loss.py
# Copyright 2017, 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
14,658
38.090667
105
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/embeddings.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
5,855
38.04
119
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/training.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
72,612
49.147099
154
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/utils.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
39,688
37.910784
120
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/model.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
13,012
46.666667
135
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/encoder.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
50,222
33.756401
113
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/convolution.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
7,935
43.58427
117
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/log.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
4,595
27.546584
103
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/gcn_sum.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, direction_num...
10,604
41.762097
154
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/layers.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
27,928
41.125189
139
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/extract_parameters.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
3,968
32.075
110
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/rnn_attention.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
37,810
44.445913
119
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/transformer.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
14,839
43.698795
118
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/grn.py
""" Implementation of a range of Graph Recurrent Networks. Trying to follow the structure of rnn_cell.py in the mxnet code. """ import mxnet as mx import sockeye.constants as C from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(inp...
11,016
40.731061
96
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/decoder.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
64,946
50.260458
129
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/gcn.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, direction_num...
10,515
41.922449
154
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/data_io.py
# Copyright 2017, 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
83,624
37.572417
140
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/lexical_constraints.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
28,775
39.991453
119
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/gcn_del.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, directions=co...
8,131
36.823256
123
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/coverage.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
17,570
44.997382
118
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/rnn.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
25,581
47.727619
139
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/gcn_cnn.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, direction_num...
11,195
42.227799
154
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/gcn_mul.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, direction_num...
7,985
37.028571
123
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/train.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
57,867
53.851185
136
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/gat.py
import mxnet as mx import sockeye.constants as C from sockeye import utils from sockeye.config import Config import logging logger = logging.getLogger(__name__) def get_gcn(config, prefix): gcn = GCNCell(input_dim=config.input_dim, output_dim=config.output_dim, direction_num...
8,015
35.770642
123
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/initializer.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
5,527
43.943089
153
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/image_captioning/inference.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
13,157
48.65283
120
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/image_captioning/score.py
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
7,408
45.30625
125
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/image_captioning/arguments.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
8,145
49.283951
137
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/image_captioning/extract_features.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
6,539
39.875
119
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/image_captioning/utils.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
7,735
36.014354
122
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/image_captioning/encoder.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
10,230
43.290043
113
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/image_captioning/captioner.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
7,715
44.656805
98
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/image_captioning/data_io.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
23,947
48.37732
128
py
EntityDescriptionGeneration
EntityDescriptionGeneration-master/sockeye/image_captioning/train.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
19,704
48.017413
130
py
focal-tversky-unet
focal-tversky-unet-master/losses.py
from keras.losses import binary_crossentropy import keras.backend as K import tensorflow as tf epsilon = 1e-5 smooth = 1 def dsc(y_true, y_pred): smooth = 1. y_true_f = K.flatten(y_true) y_pred_f = K.flatten(y_pred) intersection = K.sum(y_true_f * y_pred_f) score = (2. * intersection + smooth) / ...
2,007
28.101449
90
py
focal-tversky-unet
focal-tversky-unet-master/isic_train.py
# -*- coding: utf-8 -*- """ Created on Sun Oct 14 17:16:54 2018 @author: Nabila Abraham """ import os import cv2 import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from keras.models import Model from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Conv2DTranspose from keras....
4,794
31.619048
107
py
focal-tversky-unet
focal-tversky-unet-master/bus_train.py
# -*- coding: utf-8 -*- """ @author: Nabilla Abraham """ import os import cv2 import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from keras.models import Model from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Conv2DTranspose from keras.layers import Activation, add, multip...
5,500
31.358824
102
py
focal-tversky-unet
focal-tversky-unet-master/newmodels.py
# -*- coding: utf-8 -*- """ Created on Tue Oct 9 18:54:57 2018 @author: Nabila Abraham """ import cv2 import time import os import h5py from keras.models import Model from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Conv2DTranspose from keras.layers import Activation, add, multiply, Lambda from ke...
14,156
46.347826
172
py
melgan
melgan-master/inference.py
import os import glob import tqdm import torch import argparse from scipy.io.wavfile import write import numpy as np from model.generator import Generator from utils.hparams import HParam, load_hparam_str from utils.pqmf import PQMF from denoiser import Denoiser MAX_WAV_VALUE = 32768.0 def main(args): checkpoint...
2,398
35.348485
99
py
melgan
melgan-master/preprocess.py
import os import glob import tqdm import torch import argparse import numpy as np from utils.stft import TacotronSTFT from utils.hparams import HParam from utils.utils import read_wav_np def main(hp, args): stft = TacotronSTFT(filter_length=hp.audio.filter_length, hop_length=hp.audio.hop_...
2,005
36.148148
93
py
melgan
melgan-master/denoiser.py
import sys import torch from utils.stft import STFT class Denoiser(torch.nn.Module): """ Removes model bias from audio produced with waveglow """ def __init__(self, melgan, filter_length=1024, n_overlap=4, win_length=1024, mode='zeros'): super(Denoiser, self).__init__() self....
1,400
37.916667
84
py
melgan
melgan-master/datasets/dataloader.py
import os import glob import torch import random import numpy as np from torch.utils.data import Dataset, DataLoader from utils.utils import read_wav_np def create_dataloader(hp, args, train): dataset = MelFromDisk(hp, args, train) if train: return DataLoader(dataset=dataset, batch_size=hp.train.bat...
2,625
33.552632
109
py
melgan
melgan-master/utils/writer.py
from tensorboardX import SummaryWriter from utils.stft import TacotronSTFT from .plotting import plot_waveform_to_numpy, plot_spectrogram_to_numpy import torch class MyWriter(SummaryWriter): def __init__(self, hp, logdir): super(MyWriter, self).__init__(logdir) self.sample_rate = hp.audio.sampling_...
2,558
51.22449
113
py
melgan
melgan-master/utils/stft_loss.py
# -*- coding: utf-8 -*- # Copyright 2019 Tomoki Hayashi # MIT License (https://opensource.org/licenses/MIT) """STFT-based Loss modules.""" import torch import torch.nn.functional as F def stft(x, fft_size, hop_size, win_length, window): """Perform STFT and convert to magnitude spectrogram. Args: x...
4,910
35.110294
97
py
melgan
melgan-master/utils/stft.py
""" BSD 3-Clause License Copyright (c) 2017, Prem Seetharaman All rights reserved. * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of...
7,601
40.091892
102
py
melgan
melgan-master/utils/pqmf.py
# -*- coding: utf-8 -*- # Copyright 2020 Tomoki Hayashi # MIT License (https://opensource.org/licenses/MIT) """Pseudo QMF modules.""" import numpy as np import torch import torch.nn.functional as F from scipy.signal import kaiser def design_prototype_filter(taps=62, cutoff_ratio=0.15, beta=9.0): """Design pr...
4,482
37.646552
103
py
melgan
melgan-master/utils/validation.py
import tqdm import torch def validate(hp, args, generator, discriminator, valloader, stft_loss, sub_stft_loss, criterion, pqmf, writer, step): generator.eval() discriminator.eval() torch.backends.cudnn.benchmark = False loader = tqdm.tqdm(valloader, desc='Validation loop') loss_g_sum = 0.0 lo...
2,831
40.647059
117
py
melgan
melgan-master/utils/audio_processing.py
import torch import numpy as np from scipy.signal import get_window import librosa.util as librosa_util def window_sumsquare(window, n_frames, hop_length=200, win_length=800, n_fft=800, dtype=np.float32, norm=None): """ # from librosa 0.6 Compute the sum-square envelope of a window fu...
2,610
26.776596
83
py
melgan
melgan-master/utils/train.py
import os import math import tqdm import torch import itertools import traceback from utils.pqmf import PQMF from model.generator import Generator from model.multiscale import MultiScaleDiscriminator from .utils import get_commit_hash from .validation import validate from utils.stft_loss import MultiResolutionSTFTLoss ...
9,020
44.560606
124
py
melgan
melgan-master/model/identity.py
import torch import torch.nn as nn import torch.nn.functional as F class Identity(nn.Module): def __init__(self): super(Identity, self).__init__() def forward(self, x): return x
206
14.923077
40
py
melgan
melgan-master/model/discriminator.py
import torch import torch.nn as nn class Discriminator(nn.Module): def __init__(self, ndf = 16, n_layers = 3, downsampling_factor = 4, disc_out = 512): super(Discriminator, self).__init__() discriminator = nn.ModuleDict() discriminator["layer_0"] = nn.Sequential( nn.ReflectionP...
2,596
31.4625
94
py
melgan
melgan-master/model/multiscale.py
import torch import torch.nn as nn from utils.utils import weights_init from .discriminator import Discriminator class MultiScaleDiscriminator(nn.Module): def __init__(self, num_D = 3, ndf = 16, n_layers = 3, downsampling_factor = 4, disc_out = 512): super().__init__() self.model = nn.ModuleDict(...
6,139
38.358974
105
py
melgan
melgan-master/model/generator.py
import torch import torch.nn as nn import torch.nn.functional as F from utils.utils import weights_init from .res_stack import ResStack # from res_stack import ResStack MAX_WAV_VALUE = 32768.0 class Generator(nn.Module): def __init__(self, mel_channel, n_residual_layers, ratios=[8, 5, 5], mult = 256, out_band = ...
3,003
29.969072
99
py
melgan
melgan-master/model/res_stack.py
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class ResStack(nn.Module): def __init__(self, channel, dilation=1): super(ResStack, self).__init__() self.block = nn.Sequential( nn.LeakyReLU(0.2), nn.ReflectionPad1d(dilation), ...
1,190
31.189189
100
py
MINNs
MINNs-master/MI_Net_with_RC.py
import numpy as np import sys import time import random from random import shuffle import argparse from keras.models import Model from keras.optimizers import SGD from keras.regularizers import l2 from keras.layers import Input, Dense, Layer, Dropout, merge from mil_nets.dataset import load_dataset from mil_nets.laye...
6,542
34.950549
193
py
MINNs
MINNs-master/MI_Net.py
import numpy as np import sys import time import random from random import shuffle import argparse from keras.models import Model from keras.optimizers import SGD from keras.regularizers import l2 from keras.layers import Input, Dense, Layer, Dropout from mil_nets.dataset import load_dataset from mil_nets.layer impor...
6,132
34.247126
192
py
MINNs
MINNs-master/MI_Net_with_DS.py
import numpy as np import sys import time import random from random import shuffle import argparse from keras.models import Model from keras.optimizers import SGD from keras.regularizers import l2 from keras.layers import Input, Dense, Layer, Dropout from keras.layers.merge import average from mil_nets.dataset import...
6,987
37.395604
210
py
MINNs
MINNs-master/mi_Net.py
import sys import time from random import shuffle import numpy as np import argparse from keras.models import Model from keras.optimizers import SGD from keras.regularizers import l2 from keras.layers import Input, Dense, Layer, Dropout from mil_nets.dataset import load_dataset from mil_nets.layer import Score_poolin...
6,106
34.300578
192
py
MINNs
MINNs-master/mil_nets/pooling_method.py
from keras import backend as K def max_pooling(x): """Max Pooling to obtain aggregation. Parameters --------------------- x : Tensor (N x d) Input data to do max-pooling, where N is number of instances in one bag, and d is dimension of instance feature (when d = 1, x mea...
3,029
34.647059
102
py
MINNs
MINNs-master/mil_nets/layer.py
from keras.layers import Layer from keras import backend as K from keras import activations, initializers, regularizers from . import pooling_method as pooling class RC_block(Layer): """ Residual Connection block This layer contains a MIL pooling with the layer input to produce a tensor of outputs (ba...
9,110
37.935897
97
py
MINNs
MINNs-master/mil_nets/utils.py
import numpy as np from random import shuffle from keras.utils import np_utils # save batches, per batch contains instance features of a bag and bag label def convertToBatch(bags): """Convert to batch format. Parameters ----------------- bags : list A list contains instance features of bags and...
1,522
29.46
81
py
MINNs
MINNs-master/mil_nets/objectives.py
from keras import backend as K def bag_loss(y_true, y_pred): """Compute binary crossentropy loss of predicting bag loss. Parameters --------------------- y_true : Tensor (N x 1) GroundTruth of bag. y_pred : Tensor (1 X 1) Prediction score of bag. Return ---------------------...
598
28.95
65
py
MINNs
MINNs-master/mil_nets/metrics.py
from keras import backend as K def bag_accuracy(y_true, y_pred): """Compute accuracy of one bag. Parameters --------------------- y_true : Tensor (N x 1) GroundTruth of bag. y_pred : Tensor (1 X 1) Prediction score of bag. Return --------------------- acc : Tensor (1 x 1...
542
26.15
51
py
isochrones
isochrones-master/docs/conf.py
# -*- coding: utf-8 -*- # # isochrones documentation build configuration file, created by # sphinx-quickstart on Tue Mar 10 22:12:18 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
9,738
30.015924
102
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/setup.py
from setuptools import setup, find_namespace_packages setup(name='nnformer', packages=find_namespace_packages(include=["nnformer", "nnformer.*"]), install_requires=[ "torch>=1.6.0a", "tqdm", "dicom2nifti", "scikit-image>=0.14", "medpy", ...
2,697
58.955556
158
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/model_restore.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
7,407
45.012422
179
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/dataloading/unsupervise_mask_gen.py
import math import pdb import numpy as np import scipy.stats import torch, torch.nn.functional as F class MaskGenerator (object): """ Mask Generator """ def generate_params(self, n_masks, mask_shape, rng=None): raise NotImplementedError('Abstract') def append_to_batch(self, *batch): ...
4,947
42.026087
125
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/network_training/nnFormerTrainer_last_cut.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
39,995
53.268657
142
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/network_training/network_trainer_last_cut.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
31,619
41.614555
153
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/network_training/nnFormerTrainerV2.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
22,224
48.720358
134
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/network_training/nnFormerTrainerV2_Dual_Robust.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
31,318
47.556589
149
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/network_training/nnFormerTrainer.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
39,932
53.183175
142
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/network_training/nnFormerTrainerV2_Light.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
22,519
49.155902
119
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/network_training/nnFormerTrainerV2_Dual_Light.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
32,417
47.602699
149
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/network_training/nnFormerTrainerV2_CascadeFullRes.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
19,651
54.514124
132
py
Semi-Supervised-nnUNet
Semi-Supervised-nnUNet-master/nnformer/training/network_training/nnFormerTrainerV2_Robust.py
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
22,481
49.071269
119
py