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 |
|---|---|---|---|---|---|---|
CIF-HieraDist | CIF-HieraDist-main/fairseq/tasks/multilingual_masked_lm.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import numpy as np
import torch
from fairseq import utils
from fairseq.data import (
ConcatDataset,
Dictiona... | 12,144 | 34.825959 | 87 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq/tasks/online_backtranslation.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import json
import logging
import math
import os
from argparse import Namespace
from collections import OrderedDict, default... | 28,578 | 40.843338 | 118 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq/tasks/multilingual_translation.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import logging
import os
from collections import OrderedDict
from argparse import ArgumentError
import torch
from fairseq i... | 18,125 | 38.149028 | 118 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq/tasks/translation_lev.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from dataclasses import dataclass, field
import torch
from fairseq import utils
from fairseq.data import LanguagePairDataset
from fairseq.data... | 7,416 | 36.841837 | 103 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq/tasks/fairseq_task.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import warnings
from argparse import Namespace
from typing import Any, Callable, Dict, List
import torch
from fairse... | 26,195 | 37.020319 | 110 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq/tasks/speech_to_text.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
import logging
from pathlib import Path
from argparse import Namespace
import torch
import torch.nn.functional as F
import numpy a... | 7,517 | 34.462264 | 85 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq/tasks/audio_finetuning.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
import to... | 13,463 | 38.139535 | 95 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq/tasks/translation_multi_simple_epoch.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import datetime
import logging
import time
import torch
from fairseq.data import (
FairseqDataset,
LanguagePairDataset,
ListDatas... | 17,791 | 39.436364 | 113 | py |
CIF-HieraDist | CIF-HieraDist-main/docs/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# fairseq documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 17 21:45:30 2018.
#
# 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
# au... | 4,270 | 30.637037 | 80 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq_cli/generate.py | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Translate pre-processed data with a trained model.
"""
import ast
import logging
import math
import os
import sy... | 16,216 | 36.978923 | 180 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq_cli/validate.py | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import sys
from argparse import Namespace
from itertools import chain
import torch
from fa... | 5,228 | 32.954545 | 88 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq_cli/hydra_train.py | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
from fairseq.dataclass.initialize import add_defaults, hydra_init
from fairseq_cli.train i... | 2,715 | 28.204301 | 116 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq_cli/eval_lm.py | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Evaluate the perplexity of a trained language model.
"""
import logging
import math
import os
import sys
from a... | 11,959 | 33.367816 | 108 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq_cli/interactive.py | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Translate raw text with a trained model. Batches data on-the-fly.
"""
import ast
import fileinput
import logging... | 11,465 | 35.056604 | 88 | py |
CIF-HieraDist | CIF-HieraDist-main/fairseq_cli/train.py | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Train a new model on one or across multiple GPUs.
"""
import argparse
import logging
import math
import random
i... | 19,207 | 33.860254 | 108 | py |
SOLikeT | SOLikeT-master/docs/conf.py | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# Import SOLikeT (for autodoc)
import sys
sys.path.insert(0, "..")
# Create some mock imports
import mock
MOCK_MODUL... | 1,440 | 31.022222 | 87 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/PIPO-FAN-master/pipo_fan/train_sf_partial.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 5 16:00:33 2017
@author: yan
"""
# %% train the network
import argparse
import datetime
import math
import numpy as np
import os
from os import path
import shutil
import time
import torch
from torch import cuda
from torch import optim
#from torch.... | 24,733 | 35.480826 | 110 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/PIPO-FAN-master/pipo_fan/train_concave0.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 5 16:00:33 2017
@author: yan
"""
# %% train the network
import argparse
import datetime
import math
import numpy as np
import os
from os import path
import shutil
import time
import torch
from torch import cuda
from torch import optim
#from torch.... | 24,809 | 35.485294 | 131 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/PIPO-FAN-master/pipo_fan/segment_sf_partial.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 28 16:24:59 2017
@author: yan
Load pre-trained network to segment a new image
Code v0.01
"""
# %% Resnet blocks in U-net
import argparse
import datetime
import nibabel as nib
import numpy as np
import os
from os import path
from scipy import ndi... | 17,990 | 34.001946 | 126 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/PIPO-FAN-master/pipo_fan/dataset/dataset_liverCT_2D.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 22 14:10:33 2017
@author: yanrpi
"""
# %%
import glob
import numpy as np
import nibabel as nib
import random
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
from os import path
# from scipy.misc impo... | 16,145 | 31.552419 | 99 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/PIPO-FAN-master/pipo_fan/dataset/dataset_muor_2D.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 22 14:10:33 2017
@author: yanrpi
"""
# %%
import glob
import numpy as np
import nibabel as nib
import random
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
from os import path
# from scipy.misc impo... | 15,824 | 31.428279 | 93 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/model/denseu_net.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
class _DenseLayer(nn.Sequential):
def __init__(self, num_input_features, growth_rate, bn_size, drop_rate):
super(_DenseLayer, self).__init__()
self.add_module('norm1', nn.BatchNorm2d(num_input_fea... | 7,830 | 42.505556 | 114 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/model/unet.py | import torch
import torch.nn as nn
import torch.nn.functional as F
class double_conv(nn.Module):
'''(conv => BN => ReLU) * 2'''
def __init__(self, in_ch, out_ch):
super(double_conv, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(in_ch, out_ch, 3, padding=1),
nn.B... | 2,971 | 26.266055 | 86 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/model/resu_net.py | import torch
import torch.nn as nn
import torch.nn.functional as F
class double_conv(nn.Module):
'''(conv => BN => ReLU) * 2'''
def __init__(self, in_ch, out_ch):
super(double_conv, self).__init__()
self.conv = nn.Sequential(
nn.BatchNorm2d(in_ch),
nn.ReLU(inplace=True)... | 3,831 | 27.176471 | 86 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/model/concave_dps.py | import torch
import torch.nn as nn
import torch.nn.functional as F
class double_conv(nn.Module):
'''(conv => BN => ReLU) * 2'''
def __init__(self, in_ch, out_ch):
super(double_conv, self).__init__()
self.conv = nn.Sequential(
nn.BatchNorm2d(in_ch),
nn.ReLU(inplace=True)... | 8,568 | 29.386525 | 86 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 16/model/concave_dps_w.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from .concave_dps import ResUNet as ResUNet_0
class attention(nn.Module):
def __init__(self, in_ch, out_ch):
super(attention, self).__init__()
self.conv = nn.Sequential(
nn.BatchNorm2d(in_ch),
nn.ReLU(inplace... | 1,754 | 26.421875 | 54 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 3/main.py | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import abc
import sys
import numpy as np
import pandas as pd
from sklearn import linear_model, preprocessing, cluster
import scipy.linalg as slin
import scipy.sparse.... | 12,510 | 35.263768 | 168 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 3/influence/image_utils.py | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential, model_from_json
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.optimizers ... | 1,739 | 30.636364 | 99 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 3/influence/imagenet_utils.py | # Taken from https://github.com/fchollet/keras/blob/master/keras/applications/imagenet_utils.py
import numpy as np
import json
from keras.utils.data_utils import get_file
from keras import backend as K
CLASS_INDEX = None
CLASS_INDEX_PATH = 'https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_in... | 1,663 | 31.627451 | 105 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 3/influence/inception_v3.py | # -*- coding: utf-8 -*-
"""Inception V3 model for Keras.
Note that the input image format for this model is different than for
the VGG16 and ResNet models (299x299 instead of 224x224),
and that the input preprocessing function is also different (same as Xception).
# Reference
- [Rethinking the Inception Architecture... | 15,178 | 35.753027 | 152 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 3/influence/genericNeuralNet.py | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import abc
import sys
import numpy as np
import pandas as pd
from sklearn import linear_model, preprocessing, cluster
import scipy.linalg as slin
import scipy.sparse.... | 33,790 | 39.565426 | 158 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 3/influence/inceptionModel.py | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import abc
import sys
import numpy as np
import pandas as pd
from sklearn import linear_model, preprocessing, cluster
import scipy.linalg as slin
import scipy.sparse.l... | 11,113 | 34.059937 | 165 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 10/main_adjointMethods.py | import numpy as np
import numpy.random as npr
import tensorflow as tf
from tqdm import tqdm
import matplotlib.pyplot as plt
import tensorflow.contrib.eager as tfe
from main_neural_ode import NeuralODE
### tf.enable_eager_execution must be called at program startup. Please restart your kernel.
plt.rcParams["font.f... | 2,914 | 25.026786 | 92 | py |
IndependentEvaluation | IndependentEvaluation-main/Code For Figure 10/main_neural_ode.py | from typing import Optional, List
import numpy as np
import tensorflow as tf
from tensorflow.python.framework.ops import EagerTensor
import tensorflow.contrib.eager as tfe
keras = tf.keras
def zip_map(zipped, update_op):
return [update_op(*elems) for elems in zipped]
def euler_update(h_list, dh_list, dt):
... | 4,469 | 28.215686 | 85 | py |
enpheeph | enpheeph-main/src/enpheeph/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 12,581 | 37.477064 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/abc/lowleveltorchmaskpluginabc.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,069 | 35.117647 | 85 | py |
enpheeph | enpheeph-main/src/enpheeph/abc/pytorchinjectionabc.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 2,730 | 34.934211 | 86 | py |
enpheeph | enpheeph-main/src/enpheeph/abc/pytorchsparseinterfacepluginabc.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,162 | 35.356322 | 85 | py |
enpheeph | enpheeph-main/src/enpheeph/abc/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 12,581 | 37.477064 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/pruneddensetosparseactivationpytorchfault.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 4,498 | 34.148438 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/snnoutputnorsefault.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 5,250 | 35.72028 | 89 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/outputpytorchfault.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 4,218 | 34.158333 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/fpquantizedoutputpytorchfault.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 4,619 | 34 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/quantizedoutputpytorchfault.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 4,617 | 33.984848 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/pruneddensetosparseweightpytorchfault.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 7,989 | 35.318182 | 87 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 8,989 | 36.302905 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/densesparseoutputpytorchfault.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 4,490 | 34.085938 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/outputpytorchmonitor.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 5,405 | 37.070423 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/weightpytorchfault.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 5,994 | 32.49162 | 87 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/plugins/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 6,027 | 34.251462 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/plugins/sparse/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,677 | 33.698113 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/plugins/mask/numpypytorchmaskplugin.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 6,674 | 38.97006 | 87 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/plugins/mask/cupypytorchmaskplugin.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 6,908 | 39.168605 | 85 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/plugins/mask/autopytorchmaskplugin.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 5,947 | 38.653333 | 98 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/plugins/mask/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,424 | 31.932692 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/mixins/pytorchtensorobjectvalidatormixin.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 2,582 | 38.738462 | 84 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/mixins/pytorchmonitorpostprocessormixin.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,515 | 38.505618 | 84 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/mixins/pytorchmaskmixin.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 11,796 | 40.10453 | 87 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/mixins/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,646 | 33.40566 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/injections/mixins/pytorchsparseinterfacemixin.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 5,496 | 41.945313 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/helpers/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,640 | 29.090909 | 81 | py |
enpheeph | enpheeph-main/src/enpheeph/helpers/summaries/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,440 | 29.451327 | 81 | py |
enpheeph | enpheeph-main/src/enpheeph/helpers/summaries/modelsummarytorchinfo.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 2,062 | 38.673077 | 77 | py |
enpheeph | enpheeph-main/src/enpheeph/handlers/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,171 | 31.701031 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/handlers/plugins/pytorchhandlerplugin.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,666 | 37.6 | 80 | py |
enpheeph | enpheeph-main/src/enpheeph/handlers/plugins/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,042 | 31.72043 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/utils/enums.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 4,043 | 25.431373 | 80 | py |
enpheeph | enpheeph-main/src/enpheeph/utils/typings.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,537 | 28.239669 | 83 | py |
enpheeph | enpheeph-main/src/enpheeph/integrations/__init__.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 2,891 | 31.494382 | 88 | py |
enpheeph | enpheeph-main/src/enpheeph/integrations/pytorchlightning/injectioncallback.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 10,215 | 38.444015 | 88 | py |
enpheeph | enpheeph-main/papers/iros2022/comparisons/pytorchfi/pytorchfi_results/script.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 6,245 | 29.617647 | 85 | py |
enpheeph | enpheeph-main/papers/iros2022/comparisons/tensorfi2/alexnet-cifar10.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 14,253 | 34.108374 | 87 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/injector_script.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 22,693 | 38.605585 | 155 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/base_config.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 1,884 | 32.660714 | 79 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/image_classification_config.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,094 | 33.775281 | 78 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/cifar10_config.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 1,651 | 32.04 | 77 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/semantic_segmentantion_config.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,217 | 33.978261 | 78 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/snn_dvsgesture_config.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,267 | 34.521739 | 100 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/snn_dvsgesture_config_single.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,295 | 35.622222 | 86 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/quantization_config.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 1,291 | 30.512195 | 77 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/image_classification_config_single.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 6,648 | 38.577381 | 86 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/snn_training/dvs128gesturesnnmodule.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 22,558 | 36.978114 | 88 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/snn_training/snn_training.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 4,122 | 32.520325 | 84 | py |
enpheeph | enpheeph-main/papers/iros2022/experiments/results/configs/snn_training/dvs128gesturedatamodule.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 6,508 | 34.763736 | 86 | py |
enpheeph | enpheeph-main/tests/conftest.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 2,909 | 30.290323 | 79 | py |
enpheeph | enpheeph-main/tests/test_enpheeph/unit_test/test_injections/test_abc/test_pytorchinjectionabc.py | # -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | 3,525 | 34.26 | 88 | py |
enpheeph | enpheeph-main/notebooks/pruning_distribution_analysis/pruning_distribution_analysis_v2.2023_04_18__11_46_UTC.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Fou... | 28,259 | 34.280899 | 147 | py |
enpheeph | enpheeph-main/notebooks/pruning_distribution_analysis/pruning_distribution_analysis_v2.2023_04_15__15_28_UTC.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# enpheeph - Neural Fault Injection Framework
# Copyright (C) 2020-2023 Alessio "Alexei95" Colucci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Fou... | 21,405 | 31.482549 | 143 | py |
autoSDC | autoSDC-master/sphinx-docs/source/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# versastat documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 8 11:29:00 2018.
#
# 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
# ... | 5,159 | 29.898204 | 87 | py |
pmb-nll | pmb-nll-main/src/single_image_inference.py | """
Probabilistic Detectron Single Image Inference Script
"""
import json
import os
import sys
import cv2
import torch
import tqdm
import core
# This is very ugly. Essential for now but should be fixed.
sys.path.append(os.path.join(core.top_dir(), "src", "detr"))
from detectron2.data import MetadataCatalog
from det... | 4,694 | 32.297872 | 94 | py |
pmb-nll | pmb-nll-main/src/apply_net.py | """
Probabilistic Detectron Inference Script
"""
import json
import os
import sys
from shutil import copyfile
import torch
import tqdm
import core
# This is very ugly. Essential for now but should be fixed.
sys.path.append(os.path.join(core.top_dir(), "src", "detr"))
from detectron2.data import MetadataCatalog, bui... | 4,645 | 30.391892 | 106 | py |
pmb-nll | pmb-nll-main/src/single_image_inference_eval.py | """
Probabilistic Detectron Single Image Inference Script
Runs inference and evaluation on specified images, rather than on entire dataset.
"""
import json
import os
import sys
from shutil import copyfile, rmtree
import torch
import tqdm
import core
# This is very ugly. Essential for now but should be fixed.
sys.pat... | 7,829 | 36.644231 | 105 | py |
pmb-nll | pmb-nll-main/src/train_net.py | """
Probabilistic Detectron Training Script following Detectron2 training script found at detectron2/tools.
"""
import logging
import os
import random
import sys
import core
# This is very ugly. Essential for now but should be fixed.
sys.path.append(os.path.join(core.top_dir(), "src", "detr"))
# Detectron imports
im... | 4,421 | 28.284768 | 103 | py |
pmb-nll | pmb-nll-main/src/core/setup.py | import os
import random
import time
from shutil import copyfile
# Detectron imports
import detectron2.utils.comm as comm
import numpy as np
import torch
# Detr imports
from d2.detr.config import add_detr_config
from detectron2.config import CfgNode as CN
from detectron2.config import get_cfg
from detectron2.engine im... | 10,529 | 32.858521 | 155 | py |
pmb-nll | pmb-nll-main/src/core/evaluation_tools/scoring_rules.py | import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def sigmoid_compute_cls_scores(input_matches, valid_idxs):
"""
Computes proper scoring rule for multilabel classification results provided by retinanet.
Args:
input_matches (dict): dictionary containing input matc... | 9,442 | 37.542857 | 117 | py |
pmb-nll | pmb-nll-main/src/core/evaluation_tools/evaluation_utils.py | import json
import os
from collections import defaultdict
import numpy as np
import torch
import tqdm
# Project imports
from core.datasets import metadata
# Detectron imports
from detectron2.data import MetadataCatalog
from detectron2.structures import Boxes, Instances, pairwise_iou
device = torch.device("cuda" if ... | 37,914 | 39.079281 | 126 | py |
pmb-nll | pmb-nll-main/src/core/visualization_tools/results_processing_tools.py | import glob
import itertools
import numpy as np
import os
import pickle
import torch
from collections import defaultdict
# Project imports
from core.setup import setup_config, setup_arg_parser
from probabilistic_inference.inference_utils import get_inference_output_dir
def get_clean_results_dict(config_names,
... | 30,031 | 53.703097 | 161 | py |
pmb-nll | pmb-nll-main/src/probabilistic_inference/probabilistic_retinanet_predictor.py | import numpy as np
import torch
import math
# Detectron Imports
from detectron2.layers import batched_nms, cat
from detectron2.structures import Boxes, Instances, pairwise_iou
# Project Imports
from probabilistic_inference import inference_utils
from probabilistic_inference.inference_core import ProbabilisticPredicto... | 23,910 | 44.894434 | 152 | py |
pmb-nll | pmb-nll-main/src/probabilistic_inference/probabilistic_rcnn_predictor.py | import numpy as np
import torch
# Detectron Imports
from detectron2.layers import batched_nms
from detectron2.structures import Boxes, Instances, pairwise_iou
# Project Imports
from probabilistic_inference import inference_utils
from probabilistic_inference.inference_core import ProbabilisticPredictor
from probabili... | 20,442 | 43.733042 | 150 | py |
pmb-nll | pmb-nll-main/src/probabilistic_inference/inference_utils.py | import os
import numpy as np
import torch
from detectron2.layers import batched_nms
# Detectron imports
from detectron2.modeling.box_regression import Box2BoxTransform
from detectron2.structures import Boxes, BoxMode, Instances, pairwise_iou
from PIL import Image
# Project imports
from probabilistic_inference.image_... | 27,584 | 36.995868 | 120 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.