repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
evaluate | evaluate-main/metrics/bertscore/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("bertscore")
launch_gradio_widget(module)
| 131 | 17.857143 | 47 | py |
evaluate | evaluate-main/metrics/bertscore/bertscore.py | # Copyright 2020 The HuggingFace Evaluate Authors.
#
# 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 law or ... | 7,950 | 35.810185 | 117 | py |
evaluate | evaluate-main/metrics/exact_match/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("exact_match")
launch_gradio_widget(module)
| 133 | 18.142857 | 47 | py |
evaluate | evaluate-main/metrics/exact_match/exact_match.py | # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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.... | 5,669 | 40.386861 | 181 | py |
evaluate | evaluate-main/metrics/rl_reliability/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("rl_reliability", "online")
launch_gradio_widget(module)
| 146 | 20 | 50 | py |
evaluate | evaluate-main/metrics/rl_reliability/rl_reliability.py | # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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.... | 7,052 | 36.716578 | 139 | py |
evaluate | evaluate-main/metrics/comet/app.py | import sys
import evaluate
from evaluate.utils import launch_gradio_widget
sys.path = [p for p in sys.path if p != "/home/user/app"]
module = evaluate.load("comet")
sys.path = ["/home/user/app"] + sys.path
launch_gradio_widget(module)
| 239 | 19 | 57 | py |
evaluate | evaluate-main/metrics/comet/comet.py | # Copyright 2020 The HuggingFace Evaluate Authors.
#
# 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 law or ... | 6,967 | 39.511628 | 238 | py |
evaluate | evaluate-main/metrics/matthews_correlation/matthews_correlation.py | # Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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.... | 6,601 | 45.822695 | 115 | py |
evaluate | evaluate-main/metrics/matthews_correlation/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("matthews_correlation")
launch_gradio_widget(module)
| 142 | 19.428571 | 47 | py |
evaluate | evaluate-main/metrics/wiki_split/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("wiki_split")
launch_gradio_widget(module)
| 132 | 18 | 47 | py |
evaluate | evaluate-main/metrics/wiki_split/wiki_split.py | # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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.... | 14,638 | 38.888283 | 121 | py |
evaluate | evaluate-main/metrics/squad/squad.py | # Copyright 2020 The HuggingFace Evaluate Authors.
#
# 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 law or ... | 4,525 | 39.410714 | 113 | py |
evaluate | evaluate-main/metrics/squad/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("squad")
launch_gradio_widget(module)
| 127 | 17.285714 | 47 | py |
evaluate | evaluate-main/metrics/squad/compute_score.py | """ Official evaluation script for v1.1 of the SQuAD dataset. """
import argparse
import json
import re
import string
import sys
from collections import Counter
def normalize_answer(s):
"""Lower text and remove punctuation, articles and extra whitespace."""
def remove_articles(text):
return re.sub(r... | 3,317 | 34.677419 | 115 | py |
evaluate | evaluate-main/tests/test_evaluation_suite.py | from unittest import TestCase
from evaluate import EvaluationSuite
from tests.test_evaluator import DummyTextClassificationPipeline
class TestEvaluationSuite(TestCase):
def setUp(self):
# Check that the EvaluationSuite loads successfully
self.evaluation_suite = EvaluationSuite.load("evaluate/eval... | 1,049 | 31.8125 | 84 | py |
evaluate | evaluate-main/tests/test_hub.py | import glob
from unittest import TestCase
from unittest.mock import patch
import pytest
import requests
import yaml
from evaluate.hub import push_to_hub
from tests.test_metric import DummyMetric
minimum_metadata = {
"model-index": [
{
"results": [
{
"task"... | 6,724 | 34.771277 | 116 | py |
evaluate | evaluate-main/tests/conftest.py | import csv
import json
import lzma
import os
import tarfile
import textwrap
import datasets
import pyarrow as pa
import pyarrow.parquet as pq
import pytest
from datasets import config
from datasets.arrow_dataset import Dataset
from datasets.features import ClassLabel, Features, Sequence, Value
@pytest.fixture(autous... | 14,441 | 29.925054 | 117 | py |
evaluate | evaluate-main/tests/test_evaluator.py | # Copyright 2022 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.
#
# 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
#
# U... | 41,784 | 35.461606 | 119 | py |
evaluate | evaluate-main/tests/test_load.py | import importlib
import os
import tempfile
from unittest import TestCase
import pytest
from datasets import DownloadConfig
import evaluate
from evaluate.loading import (
CachedEvaluationModuleFactory,
HubEvaluationModuleFactory,
LocalEvaluationModuleFactory,
evaluation_module_factory,
)
from .utils i... | 5,516 | 38.12766 | 113 | py |
evaluate | evaluate-main/tests/utils.py | import os
import tempfile
import unittest
from contextlib import contextmanager
from copy import deepcopy
from distutils.util import strtobool
from enum import Enum
from pathlib import Path
from unittest.mock import patch
from evaluate import config
def parse_flag_from_env(key, default=False):
try:
value... | 8,548 | 28.378007 | 108 | py |
evaluate | evaluate-main/tests/test_metric_common.py | # Copyright 2020 HuggingFace Inc.
#
# 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 law or agreed to in writ... | 8,676 | 37.057018 | 118 | py |
evaluate | evaluate-main/tests/test_file_utils.py | import os
from pathlib import Path
from unittest.mock import patch
import pytest
from evaluate.utils.file_utils import OfflineModeIsEnabled, cached_path, ftp_get, ftp_head, http_get, http_head
FILE_CONTENT = """\
Text data.
Second line of data."""
def test_cached_path_local(text_file):
# absolute path... | 1,794 | 30.491228 | 111 | py |
evaluate | evaluate-main/tests/__init__.py | 0 | 0 | 0 | py | |
evaluate | evaluate-main/tests/test_trainer_evaluator_parity.py | import json
import os
import shutil
import subprocess
import tempfile
import unittest
import numpy as np
import torch
import transformers
from datasets import load_dataset
from transformers import AutoFeatureExtractor, AutoModelForImageClassification, Trainer, TrainingArguments, pipeline
from evaluate import evaluato... | 11,804 | 36.595541 | 116 | py |
evaluate | evaluate-main/tests/test_metric.py | import os
import pickle
import tempfile
import time
from multiprocessing import Pool
from unittest import TestCase, mock
import pytest
from datasets.features import Features, Sequence, Value
from evaluate.module import EvaluationModule, EvaluationModuleInfo, combine
from .utils import require_tf, require_torch
cla... | 29,981 | 38.45 | 117 | py |
evaluate | evaluate-main/tests/test_viz.py | from unittest import TestCase
import matplotlib.pyplot as plt
from evaluate.visualization import radar_plot
class TestViz(TestCase):
def test_invert_range(self):
data = [{"accuracy": 0.9, "precision": 0.8}, {"accuracy": 0.7, "precision": 0.6}]
model_names = ["model1", "model2"]
wrong_inv... | 909 | 35.4 | 89 | py |
evaluate | evaluate-main/tests/test_save.py | import json
import shutil
import tempfile
from pathlib import Path
from unittest import TestCase
import evaluate
result_dict = {"metric": 1.0, "model_name": "x"}
SAVE_EXTRA_KEYS = ["_timestamp", "_git_commit_hash", "_evaluate_version", "_python_version", "_interpreter_path"]
class TestSave(TestCase):
def setU... | 1,481 | 31.933333 | 113 | py |
evaluate | evaluate-main/measurements/honest/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("honest", "en")
launch_gradio_widget(module)
| 134 | 18.285714 | 47 | py |
evaluate | evaluate-main/measurements/honest/honest.py | # Source: https://github.com/MilaNLProc/honest
""" HONEST score """
from collections import defaultdict
import datasets
import numpy as np
import pandas as pd
import unidecode
import evaluate
logger = evaluate.logging.get_logger(__name__)
_CITATION = """
@inproceedings{nozza-etal-2021-honest,
title = {"{HON... | 7,697 | 39.09375 | 161 | py |
evaluate | evaluate-main/measurements/word_length/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("word_length", module_type="measurement")
launch_gradio_widget(module)
| 160 | 22 | 64 | py |
evaluate | evaluate-main/measurements/word_length/word_length.py | # Copyright 2022 The HuggingFace Team. 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 applicabl... | 2,865 | 32.717647 | 113 | py |
evaluate | evaluate-main/measurements/label_distribution/label_distribution.py | # Copyright 2022 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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.... | 3,876 | 40.244681 | 219 | py |
evaluate | evaluate-main/measurements/label_distribution/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("label_distribution", module_type="measurement")
launch_gradio_widget(module)
| 167 | 23 | 71 | py |
evaluate | evaluate-main/measurements/word_count/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("word_count")
launch_gradio_widget(module)
| 132 | 18 | 47 | py |
evaluate | evaluate-main/measurements/word_count/word_count.py | # Copyright 2022 The HuggingFace Team. 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 applicabl... | 2,541 | 35.314286 | 106 | py |
evaluate | evaluate-main/measurements/perplexity/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("perplexity", module_type="measurement")
launch_gradio_widget(module)
| 159 | 21.857143 | 63 | py |
evaluate | evaluate-main/measurements/perplexity/perplexity.py | # Copyright 2022 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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.... | 8,604 | 43.35567 | 200 | py |
evaluate | evaluate-main/measurements/text_duplicates/text_duplicates.py | # Copyright 2022 The HuggingFace Team. 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 applicabl... | 3,347 | 35.791209 | 144 | py |
evaluate | evaluate-main/measurements/text_duplicates/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("text_duplicates")
launch_gradio_widget(module)
| 137 | 18.714286 | 47 | py |
evaluate | evaluate-main/measurements/toxicity/toxicity.py | # Copyright 2020 The HuggingFace Evaluate Authors.
#
# 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 law or ... | 6,077 | 41.802817 | 150 | py |
evaluate | evaluate-main/measurements/toxicity/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("toxicity")
launch_gradio_widget(module)
| 130 | 17.714286 | 47 | py |
evaluate | evaluate-main/measurements/regard/app.py | import evaluate
from evaluate.utils import launch_gradio_widget
module = evaluate.load("regard")
launch_gradio_widget(module)
| 128 | 17.428571 | 47 | py |
evaluate | evaluate-main/measurements/regard/regard.py | # Copyright 2020 The HuggingFace Evaluate Authors.
#
# 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 law or ... | 8,406 | 45.447514 | 168 | py |
airloc | airloc-master/plot_results.py | #!/bin/env python3
import os
import time
import sys
import math
import glob
from dateutil.parser import parse
import numpy as np
from config import CONFIG
import json
import argparse
from utils.utils import find_latest_log
MA_SMOOTH = 0.02
START_ITER_PLOT = 50
# Metrics with shared y_axis
metricsWithSharedY = dic... | 11,151 | 33.85 | 157 | py |
airloc | airloc-master/config.py | """
Central configration file for the project. Acts as a storage
of global variables and various configuration settings.
"""
import os
import pprint
from easydict import EasyDict as edict
from datetime import datetime
CONFIG = edict()
"""
Evaluation of RL-agent
"""
# These settings control the evaluation runs of th... | 5,563 | 37.109589 | 186 | py |
airloc | airloc-master/__init__.py | 0 | 0 | 0 | py | |
airloc | airloc-master/networks/rl_agent.py | import torch
import torch.nn as nn
import torch.nn.init as init
import math
import random
import sys
import os
import torch.nn.functional as F
from config import CONFIG
from networks.resnets import ResNet18
from torchvision.models.feature_extraction import get_graph_node_names
from torchvision.models.feature_extraction... | 3,679 | 30.724138 | 111 | py |
airloc | airloc-master/networks/agent.py | import torch
import importlib.util
import torch.nn as nn
import torch.nn.init as init
import math
import random
import sys
import os
import torch.nn.functional as F
from config import CONFIG
from networks.resnets import ResNet18
from torchvision.models.feature_extraction import get_graph_node_names
from torchvision.mod... | 13,032 | 40.243671 | 150 | py |
airloc | airloc-master/networks/RandomAgent.py | import torch
import importlib.util
import torch.nn as nn
import torch.nn.init as init
import math
import random
import sys
import os
import torch.nn.functional as F
from config import CONFIG
from networks.resnets import ResNet18
from torchvision.models.feature_extraction import get_graph_node_names
from torchvision.mod... | 2,861 | 30.450549 | 76 | py |
airloc | airloc-master/networks/rnn_agents.py |
import torch
import torch.nn as nn
import torchvision.transforms as transforms
import torch.nn.functional as F
import os
import importlib.util
import time
import json
import math
from utils.utils import calculate_cnn_output_size, cosine_sim_heatmap
from utils.agent_utils import visualize_cnn_filter, get_outside
import... | 18,173 | 43.004843 | 156 | py |
airloc | airloc-master/networks/__init__.py | 0 | 0 | 0 | py | |
airloc | airloc-master/networks/deterministic_agent.py |
import torch
import importlib.util
import torch.nn as nn
import torch.nn.init as init
import math
import random
import sys
import os
import torch.nn.functional as F
from config import CONFIG
from networks.resnets import ResNet18
from torchvision.models.feature_extraction import get_graph_node_names
from torchvision.m... | 4,074 | 27.496503 | 113 | py |
airloc | airloc-master/networks/resnets.py |
import torch
import torch.nn as nn
import math
import random
import sys
import os
import torch.nn.functional as F
import torchvision.models as models
from torch.autograd import Variable
# During dev
#sys.path.append(os.path.abspath('..'))
#execfile(os.path.join(__file__, '../config.py'))
from config import CONFI... | 983 | 19.5 | 87 | py |
airloc | airloc-master/training/train_agent.py | import traceback
import pdb
from datetime import datetime
import random
import signal
import time
import numpy as np
import json
import os
import sys
# matplotlib is used for debugging image inputs to networks
import matplotlib
import matplotlib.pyplot as plt
from copy import deepcopy
import torch
import torch.nn as nn... | 16,125 | 37.122931 | 163 | py |
airloc | airloc-master/training/__init__.py | 0 | 0 | 0 | py | |
airloc | airloc-master/training/run_deterministic.py |
from datetime import datetime
import random
import time
import numpy as np
import json
from shutil import copyfile
import os
import sys
# matplotlib is used for debugging image inputs to networks
import matplotlib
import matplotlib.pyplot as plt
#matplotlib.use('TkAgg')
from copy import deepcopy
import torch
from to... | 12,201 | 33.179272 | 142 | py |
airloc | airloc-master/eval/eval_agent.py | from datetime import datetime
import random
import time
import numpy as np
import json
import os
import sys
import importlib
# matplotlib is used for debugging image inputs to networks
import matplotlib
import matplotlib.pyplot as plt
#matplotlib.use('TkAgg')
import torch
import torchvision.transforms as transforms
imp... | 11,306 | 40.417582 | 160 | py |
airloc | airloc-master/eval/__init__.py | 0 | 0 | 0 | py | |
airloc | airloc-master/logs/2022-06-23_08-29-00-213310_residual_nosemseg_seed0/config.py | """
Central configration file for the project. Acts as a storage
of global variables and various configuration settings.
TODO TODO TODO: Remove unnecessary fields below; this is copied from an earlier
project
"""
import os
import pprint
from easydict import EasyDict as edict
from datetime import datetime
import socke... | 8,709 | 32.117871 | 119 | py |
airloc | airloc-master/logs/2022-09-13_14-07-42-505667_pre_disaster/config.py | """
Central configration file for the project. Acts as a storage
of global variables and various configuration settings.
TODO TODO TODO: Remove unnecessary fields below; this is copied from an earlier
project
"""
import os
import pprint
from easydict import EasyDict as edict
from datetime import datetime
CONFIG = e... | 5,241 | 33.946667 | 148 | py |
airloc | airloc-master/logs/2022-06-23_08-30-12-761837_residual_semseg/config.py | """
Central configration file for the project. Acts as a storage
of global variables and various configuration settings.
TODO TODO TODO: Remove unnecessary fields below; this is copied from an earlier
project
"""
import os
import pprint
from easydict import EasyDict as edict
from datetime import datetime
import socke... | 8,716 | 32.270992 | 119 | py |
airloc | airloc-master/doerchnet/plot_results.py | #!/bin/env python3
import os
import time
import sys
import math
from dateutil.parser import parse
import numpy as np
from config import CONFIG
import json
import argparse
from utils.utils import find_latest_log
MA_SMOOTH = 0.01
START_ITER_PLOT = 30
# For some, inxplicable reason, need to run this here??
# What a... | 8,056 | 31.099602 | 134 | py |
airloc | airloc-master/doerchnet/share_net.py |
import torch
import torch.nn as nn
from config import CONFIG
class ShareNet(nn.Module):
def __init__(self , num_out_classes = 8):
super(ShareNet, self).__init__()
# Check wether to include segmentation channel
if CONFIG.RL_priv_use_seg or CONFIG.RL_predict_seg_mask:
self... | 2,785 | 24.796296 | 115 | py |
airloc | airloc-master/doerchnet/utils.py | import torch
import numpy as np
import torchvision.transforms as transforms
import os
import gc
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import urllib
import matplotlib
import random
from torch.nn.functional import one_hot
from config import CONFIG
from utils.utils import get_deterministic... | 16,618 | 40.967172 | 172 | py |
airloc | airloc-master/doerchnet/networks.py |
import torch
import torch.nn as nn
import torch.nn.functional as F
from config import CONFIG
class AJNet(nn.Module):
def __init__(self,net_type,mode = 'train', unit_size = 128,num_classes =8 , both_branches = True):
super(AJNet,self).__init__()
# Allow for pretraining network with ground t... | 4,630 | 27.763975 | 103 | py |
airloc | airloc-master/doerchnet/train.py | import os
import torch
import random
import torch.nn.functional as F
import torchvision.transforms as transforms
import torch.nn as nn
import json
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from shutil import copyfile
from utils.utils import get_random_crops, get_deterministic_crops, load_... | 12,721 | 36.528024 | 176 | py |
airloc | airloc-master/doerchnet/logs/with-sem-seg/share_net.py |
import torch
import torch.nn as nn
from config import CONFIG
class ShareNet(nn.Module):
def __init__(self , num_out_classes = 8):
super(ShareNet, self).__init__()
# Check wether to include segmentation channel
if CONFIG.RL_priv_use_seg or CONFIG.RL_predict_seg_mask:
self... | 2,784 | 25.028037 | 115 | py |
airloc | airloc-master/doerchnet/logs/without-sem-seg/share_net.py |
import torch
import torch.nn as nn
from config import CONFIG
class ShareNet(nn.Module):
def __init__(self , num_out_classes = 8):
super(ShareNet, self).__init__()
# Check wether to include segmentation channel
if CONFIG.RL_priv_use_seg:
self.seg_chan = 1
else:
... | 2,755 | 24.518519 | 115 | py |
airloc | airloc-master/doerchnet/logs/without-sem-seg-pre-michael/share_net.py |
import torch
import torch.nn as nn
from config import CONFIG
class ShareNet(nn.Module):
def __init__(self , num_out_classes = 8):
super(ShareNet, self).__init__()
# Check wether to include segmentation channel
if CONFIG.RL_priv_use_seg or CONFIG.RL_predict_seg_mask:
self... | 2,785 | 24.796296 | 115 | py |
airloc | airloc-master/doerchnet/logs/without-sem-seg-pre-michael/networks.py |
import torch
import torch.nn as nn
import torch.nn.functional as F
from config import CONFIG
class AJNet(nn.Module):
def __init__(self,net_type,mode = 'train', unit_size = 128,num_classes =8 , both_branches = True):
super(AJNet,self).__init__()
# Allow for pretraining network with ground t... | 4,630 | 27.763975 | 103 | py |
airloc | airloc-master/doerchnet/logs/without-sem-seg-pre-michael/config.py | """
Central configration file for the project. Acts as a storage
of global variables and various configuration settings.
TODO TODO TODO: Remove unnecessary fields below; this is copied from an earlier
project
"""
import os
import pprint
from easydict import EasyDict as edict
from datetime import datetime
import socke... | 5,311 | 33.718954 | 153 | py |
airloc | airloc-master/doerchnet/logs/without-sem-seg-pre-michael/train.py | import os
import torch
import random
import torch.nn.functional as F
import torchvision.transforms as transforms
import torch.nn as nn
import json
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from shutil import copyfile
from utils.utils import get_random_crops, get_deterministic_crops, load_... | 12,708 | 36.600592 | 176 | py |
airloc | airloc-master/segmentations/plot_results.py | #!/bin/env python3
import os
import time
import sys
import math
from dateutil.parser import parse
import numpy as np
from config import CONFIG
import json
import argparse
from utils.utils import find_latest_log
MA_SMOOTH = 0.0025
START_ITER_PLOT = 30
# What are the customs_mas ?
def _custom_ma(data, ma_smooth=MA_S... | 8,700 | 32.988281 | 128 | py |
airloc | airloc-master/segmentations/unet_model.py | """ Full assembly of the parts to form the complete network """
from .unet_parts import *
class UNet(nn.Module):
def __init__(self, n_channels, n_classes, bilinear=False):
super(UNet, self).__init__()
self.n_channels = n_channels
self.n_classes = n_classes
self.bilinear = bilinear... | 1,130 | 29.567568 | 63 | py |
airloc | airloc-master/segmentations/u_net.py |
import torch
import torch.nn as nn
import torch.nn.functional as F
from config import CONFIG
class UNet(nn.Module):
def __init__(self, n_channels, n_classes, bilinear=False):
super(UNet, self).__init__()
self.n_channels = n_channels
self.n_classes = n_classes
self.bilinear ... | 4,019 | 29.687023 | 122 | py |
airloc | airloc-master/segmentations/utils.py | from config import CONFIG
import math
import json
import os
import time
import zipfile
import gc
import numpy as np
import torch
import torchvision
import torchvision.transforms as transforms
from torchvision.datasets import ImageFolder
from torch.utils.data import random_split,Subset
import matplotlib
matplotlib.use(... | 5,241 | 27.802198 | 114 | py |
airloc | airloc-master/segmentations/unet_parts.py | """ Parts of the U-Net model """
import torch
import torch.nn as nn
import torch.nn.functional as F
class DoubleConv(nn.Module):
"""(convolution => [BN] => ReLU) * 2"""
def __init__(self, in_channels, out_channels, mid_channels=None):
super().__init__()
if not mid_channels:
mid_c... | 2,602 | 32.371795 | 122 | py |
airloc | airloc-master/segmentations/networks.py |
import random
from config import CONFIG
import torch
import torchvision.transforms as transforms
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from utils.utils import calculate_cnn_output_size
class BakeNet(nn.Module):
def __init__(self, n_out_chan = 2):
super(B... | 1,229 | 25.170213 | 73 | py |
airloc | airloc-master/segmentations/train.py |
import os
import torch
import random
import torchvision
import torchvision.transforms as transforms
import torch.nn.functional as F
import torch.nn as nn
import json
import numpy as np
from torchinfo import summary
from shutil import copyfile
from utils.utils import get_random_crops, get_deterministic_crops, load_n... | 9,545 | 32.261324 | 126 | py |
airloc | airloc-master/segmentations/logs/sem-seg-model/u_net.py |
import torch
import torch.nn as nn
import torch.nn.functional as F
from config import CONFIG
class UNet(nn.Module):
def __init__(self, n_channels, n_classes, bilinear=False):
super(UNet, self).__init__()
self.n_channels = n_channels
self.n_classes = n_classes
self.bilinear ... | 4,019 | 29.687023 | 122 | py |
airloc | airloc-master/utils/agent_utils.py |
import math
import os
import time
import zipfile
import warnings
import gc
import numpy as np
import torch
import torchvision
import torchvision.transforms as transforms
from torch.distributions import MultivariateNormal, OneHotCategorical
import matplotlib
import matplotlib.pyplot as plt
from torch.nn import Cross... | 16,432 | 31.158513 | 150 | py |
airloc | airloc-master/utils/dataset_utils.py | import os
import random
import torch
from PIL import Image
import pandas as pd
from torch.utils.data.dataset import Dataset
from torchvision import transforms
import torchvision.transforms.functional as F
import numpy as np
import glob
from config import CONFIG
import argparse
import sys
import time
class DubaiSeven(... | 37,541 | 36.617234 | 186 | py |
airloc | airloc-master/utils/utils.py | import math
import json
import os
import time
import zipfile
import signal
import pdb
import gc
from shutil import copyfile
import numpy as np
import torch
from glob import glob
# Might not be available on RISE
import seaborn as sns
import torchvision
import torchvision.transforms as transforms
from torchvision.datase... | 40,412 | 38.159884 | 181 | py |
airloc | airloc-master/utils/create_split_file.py |
import pandas as pd
import os
import matplotlib
import argparse
import torch
from utils.dataset_utils import *
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
import time
import numpy as np
from doerchnet.utils import visualize_doerch
from utils.utils import sample_grid_games_fixed_distan... | 5,333 | 34.324503 | 143 | py |
airloc | airloc-master/utils/create_game_files.py | #!/bin/env python3
import numpy as np
import random
import pandas as pd
from shutil import copyfile
import argparse
import os, sys
from config import CONFIG
argparse = argparse.ArgumentParser()
argparse.add_argument("--seed" , type = int , default = 0 , help = "Set seed for random number generators")
argparse.add... | 3,539 | 29 | 173 | py |
airloc | airloc-master/utils/training_utils.py | import torch
import sys
import numpy as np
import torchvision.transforms as transforms
from copy import deepcopy
import time
import math
import torchvision.transforms.functional as F
from torchvision.transforms import Resize
from utils.agent_utils import rewards_to_go, normalize_batch_weights
from utils.utils import ... | 18,061 | 44.38191 | 181 | py |
airloc | airloc-master/utils/split_images.py | import os
import math
import glob
from PIL import Image
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.colors import rgb2hex,to_rgb
from config import CONFIG
import cv2
import numpy as np
import regex as re
matplotlib.use('Agg')
data = 'masa'
if data == 'dubai':
labels = ['#3C1098', '#... | 4,196 | 35.815789 | 162 | py |
airloc | airloc-master/utils/normalize_dataset.py | #!/bin/env python3
import os
import numpy as np
import imageio as iio
import time
import torch
import json
import torchvision.transforms as transforms
from torchvision.datasets import ImageFolder
from torch.utils.data import random_split,Subset
from utils.dataset_utils import CustomDataset, Dubai, Masa, MasaFilt, MasaF... | 4,167 | 37.592593 | 121 | py |
airloc | airloc-master/utils/__init__.py | 0 | 0 | 0 | py | |
airloc | airloc-master/utils/stat_collector.py | import os
import sys
import numpy as np
from collections import OrderedDict
import gc
import matplotlib
import matplotlib.pyplot as plt
import math
def replace(string_in, replace_from, replace_to='_'):
if not isinstance(replace_from, list):
replace_from = [replace_from]
string_out = string_in
for ... | 9,955 | 31.429967 | 97 | py |
aabbcc | aabbcc-master/python/setup.py | #!/usr/bin/env python
"""
setup.py file for the AABB.cc python interface.
"""
from distutils.core import setup, Extension
aabb_module = Extension('_aabb',
sources = ['aabb_wrap.cxx', '../src/AABB.cc'],
extra_compile_args = ["-O3", "-std=c++11"],
... | 635 | 26.652174 | 71 | py |
aabbcc | aabbcc-master/python/hard_disc.py | #!/usr/bin/env python2
# Copyright (c) 2016-2018 Lester Hedges <[email protected]>
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
# Permission is granted to anyone to us... | 13,088 | 33.444737 | 102 | py |
emcee3 | emcee3-master/benchmark.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import time
import numpy as np
import emcee
import emcee3
def lnprob(x):
return -0.5 * np.sum(x**2)
N = 5000
coords = np.random.randn(56, 10)
emcee_sampler = emcee.EnsembleSampler(coords.shape[0], coords.shape[1],
... | 674 | 18.852941 | 71 | py |
emcee3 | emcee3-master/setup.py | # -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
if "test" in sys.argv:
version = "0.0.0"
else:
# Hackishly inject a constant into builtins to enable importing of the
# package even if numpy isn't installed. Only do this if ... | 2,752 | 27.091837 | 74 | py |
emcee3 | emcee3-master/emcee3/autocorr.py | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import logging
import numpy as np
__all__ = ["function", "integrated_time", "AutocorrError"]
def function(x, axis=0, fast=False):
"""Estimate the autocorrelation function of a time series using the FFT.
Args:
x: The time serie... | 5,041 | 35.536232 | 79 | py |
emcee3 | emcee3-master/emcee3/state.py | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import numpy as np
__all__ = ["State"]
class State(object):
"""The current state of a walker.
This object captures the state of a walker. It will store the coordinates,
probabilities, and any other computed metadata. Metadata can ... | 4,948 | 32.439189 | 78 | py |
emcee3 | emcee3-master/emcee3/model.py | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import numpy as np
from .state import State
from .numgrad import numerical_gradient_1, numerical_gradient_2
__all__ = ["is_model", "Model", "SimpleModel"]
def is_model(model):
return (
hasattr(model, "compute_log_probability") and
... | 9,545 | 34.225092 | 79 | py |
emcee3 | emcee3-master/emcee3/__init__.py | # -*- coding: utf-8 -*-
__version__ = "3.0.0.dev0"
try:
__EMCEE3_SETUP__
except NameError:
__EMCEE3_SETUP__ = False
if not __EMCEE3_SETUP__:
__all__ = [
"moves",
"pools",
"autocorr",
"Model",
"SimpleModel",
"Sampler",
"Ensemble",
"State",
... | 506 | 17.777778 | 41 | py |
emcee3 | emcee3-master/emcee3/ensemble.py | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import numpy as np
from .pools import DefaultPool
from .model import is_model, SimpleModel
__all__ = ["Ensemble"]
class Ensemble(object):
"""The state of the ensemble of walkers.
Args:
model (callable or Model): The model spe... | 4,828 | 33.741007 | 78 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.