python_code stringlengths 0 679k | repo_name stringlengths 9 41 | file_path stringlengths 6 149 |
|---|---|---|
#
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/tests/sparksession.py |
#
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 ag... | spark-rapids-ml-branch-23.10 | python/tests/test_common_estimator.py |
#
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/tests/test_random_forest.py |
from typing import List, Tuple
import numpy as np
import pandas as pd
import pytest
from _pytest.logging import LogCaptureFixture
from pyspark.sql import DataFrame
from sklearn.datasets import make_blobs
from spark_rapids_ml.core import alias
from spark_rapids_ml.knn import NearestNeighbors
from .sparksession import... | spark-rapids-ml-branch-23.10 | python/tests/test_nearest_neighbors.py |
#
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 ag... | spark-rapids-ml-branch-23.10 | python/tests/test_pca.py |
from typing import Any, Dict, Tuple, Type, TypeVar
import cuml
import numpy as np
import pytest
from _pytest.logging import LogCaptureFixture
from packaging import version
from pyspark.ml.classification import LogisticRegression as SparkLogisticRegression
from pyspark.ml.classification import (
LogisticRegressionM... | spark-rapids-ml-branch-23.10 | python/tests/test_logistic_regression.py |
#
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 ag... | spark-rapids-ml-branch-23.10 | python/tests/test_kmeans.py |
#
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/tree.py |
#
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/params.py |
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 agre... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/regression.py |
#
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 ag... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/clustering.py |
#
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/classification.py |
#
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/__init__.py |
#
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 ag... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/core.py |
#
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 ag... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/feature.py |
#
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/umap.py |
#
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 ag... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/utils.py |
#
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/tuning.py |
#
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 ag... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/knn.py |
#
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/metrics/__init__.py |
#
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/metrics/MulticlassMetrics.py |
#
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/metrics/RegressionMetrics.py |
#
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# 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 ... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/common/__init__.py |
#
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# 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 ag... | spark-rapids-ml-branch-23.10 | python/src/spark_rapids_ml/common/cuml_context.py |
from typing import Dict, List, Tuple
import argparse
import os
import subprocess
import sys
from multiprocessing import Pool, cpu_count
from pylint import epylint
# This script is copied from dmlc/xgboost
CURDIR = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
PROJECT_ROOT = os.path.normpath(os.path.jo... | spark-rapids-ml-branch-23.10 | ci/lint_python.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
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | spark-rapids-ml-branch-23.10 | docs/source/conf.py |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/conftest.py |
import os
import sys
import setuptools
package_path = os.path.join(os.path.dirname(__file__), 'rosetta')
sys.path.append(package_path)
from rosetta import __version__ # noqa: E402
# Get the long description from the README file.
with open('README.md') as fp:
_LONG_DESCRIPTION = fp.read()
setuptools.setup(
na... | JAX-Toolbox-main | rosetta/setup.py |
import pytest
def test_placeholder():
assert 1 == 1
@pytest.mark.integration
def test_integration_placeholder():
assert 1 == 1
| JAX-Toolbox-main | rosetta/rosetta/test_placeholder.py |
__version__ = '0.0.1.dev0'
| JAX-Toolbox-main | rosetta/rosetta/__init__.py |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/projects/vit/models_test.py |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/projects/vit/config.py |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/projects/vit/dali_utils.py |
# Copyright (c) 2023, The T5X 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 agreed to in... | JAX-Toolbox-main | rosetta/rosetta/projects/vit/models.py |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/projects/vit/dali_utils_test.py |
JAX-Toolbox-main | rosetta/rosetta/projects/vit/__init__.py | |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/projects/vit/utils.py |
# Copyright 2022 Google LLC.
# Copyright (c) 2023, NVIDIA CORPORATION. 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
... | JAX-Toolbox-main | rosetta/rosetta/projects/vit/layers.py |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/projects/vit/integration_test.py |
# Copyright 2022 Google LLC.
# Copyright (c) 2023, NVIDIA CORPORATION. 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
... | JAX-Toolbox-main | rosetta/rosetta/projects/vit/scripts/convert_t5x_pretrain_to_finetune_ckpt.py |
JAX-Toolbox-main | rosetta/rosetta/projects/vit/scripts/__init__.py | |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/data/dali_test.py |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/data/generate_wds_indices_test.py |
JAX-Toolbox-main | rosetta/rosetta/data/__init__.py | |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/data/wds_utils.py |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 applic... | JAX-Toolbox-main | rosetta/rosetta/data/generate_wds_indices.py |
# Copyright (c) 2023, The T5X 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 agreed to in... | JAX-Toolbox-main | rosetta/rosetta/data/dali.py |
import os
import sys
import numpy as np
import json
def main():
if len(sys.argv) < 3:
sys.exit(1)
config = sys.argv[1]
run_dirs = sys.argv[2:]
# Store metrics data as list of dicts
json_fnames = [f"{r}/{config}_metrics.json" for r in run_dirs]
src_data = []
for fname in json_fname... | JAX-Toolbox-main | .github/workflows/baselines/average_baselines.py |
from tensorboard.backend.event_processing import event_accumulator
from tensorboard.util import tensor_util
def read_tb_tag(tb_file: str, summary_name: str) -> dict:
ea = event_accumulator.EventAccumulator(tb_file)
ea.Reload()
return {
event.step: tensor_util.make_ndarray(event.tensor_proto).item... | JAX-Toolbox-main | .github/workflows/baselines/test_utils.py |
import os
import json
import glob
import sys
from statistics import mean
from test_utils import read_tb_tag, read_e2e_time
def _create_summary(loss, train_time, e2e_time):
steps = list(loss.keys())
intervals = [k2 - k1 for k1, k2 in zip(loss.keys(), steps[1:])]
assert all(i == intervals[0] for i in interv... | JAX-Toolbox-main | .github/workflows/baselines/summarize_metrics.py |
import pytest
import os
import json
import glob
import test_utils
from statistics import mean
STEP_TIME_MULT = {
"1DP1TP1PP": 0.95,
"8DP1TP1PP": 0.95,
"1DP8TP1PP": 0.95,
"2DP1TP4PP": 0.95,
"16DP1TP1PP": 0.95,
"2DP2TP4PP": 0.95,
}
E2E_TIME_MULT = {
"1DP1TP1PP": 0.95,
"8DP1TP1PP": ... | JAX-Toolbox-main | .github/workflows/baselines/test_pax_mgmn_metrics.py |
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
setup(
name='odtk',
version='0.2.6',
description='Fast and accurate single shot object detector',
author = 'NVIDIA Corporation',
packages=['odtk', 'odtk.backbones'],
ext_modules=[CUDAExtension('odtk... | retinanet-examples-main | setup.py |
import torch
from ._C import decode as decode_cuda
from ._C import iou as iou_cuda
from ._C import nms as nms_cuda
import numpy as np
from .utils import order_points, rotate_boxes
def generate_anchors(stride, ratio_vals, scales_vals, angles_vals=None):
'Generate anchors coordinates from scales/ratios'
scales ... | retinanet-examples-main | odtk/box.py |
from . import backbones
| retinanet-examples-main | odtk/__init__.py |
import os.path
import io
import numpy as np
import math
import torch
import torch.nn as nn
from . import backbones as backbones_mod
from ._C import Engine
from .box import generate_anchors, snap_to_anchors, decode, nms
from .box import generate_anchors_rotated, snap_to_anchors_rotated, nms_rotated
from .loss import Fo... | retinanet-examples-main | odtk/model.py |
from contextlib import redirect_stdout
from math import ceil
import ctypes
import torch
from nvidia.dali import pipeline, ops, types
from pycocotools.coco import COCO
class COCOPipeline(pipeline.Pipeline):
'Dali pipeline for COCO'
def __init__(self, batch_size, num_threads, path, training, annotations, world,... | retinanet-examples-main | odtk/dali.py |
import torch
import torch.nn as nn
import torch.nn.functional as F
class FocalLoss(nn.Module):
'Focal Loss - https://arxiv.org/abs/1708.02002'
def __init__(self, alpha=0.25, gamma=2):
super().__init__()
self.alpha = alpha
self.gamma = gamma
def forward(self, pred_logits, target):
... | retinanet-examples-main | odtk/loss.py |
import os.path
import time
import json
import warnings
import signal
from datetime import datetime
from contextlib import contextmanager
from PIL import Image, ImageDraw
import requests
import numpy as np
import math
import torch
def order_points(pts):
pts_reorder = []
for idx, pt in enumerate(pts):
... | retinanet-examples-main | odtk/utils.py |
from statistics import mean
from math import isfinite
import torch
from torch.optim import SGD, AdamW
from torch.optim.lr_scheduler import LambdaLR
from apex import amp, optimizers
from apex.parallel import DistributedDataParallel as ADDP
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.cuda.amp ... | retinanet-examples-main | odtk/train.py |
import os
import json
import tempfile
from contextlib import redirect_stdout
import torch
from apex import amp
from apex.parallel import DistributedDataParallel as ADDP
from torch.nn.parallel import DistributedDataParallel
from pycocotools.cocoeval import COCOeval
import numpy as np
from .data import DataIterator, Rot... | retinanet-examples-main | odtk/infer.py |
#!/usr/bin/env python3
import sys
import os
import argparse
import random
import torch.cuda
import torch.distributed
import torch.multiprocessing
from odtk import infer, train, utils
from odtk.model import Model
from odtk._C import Engine
def parse(args):
parser = argparse.ArgumentParser(description='ODTK: Objec... | retinanet-examples-main | odtk/main.py |
import os
import random
from contextlib import redirect_stdout
from PIL import Image
import torch
import torch.nn.functional as F
from torch.utils import data
from pycocotools.coco import COCO
import math
from torchvision.transforms.functional import adjust_brightness, adjust_contrast, adjust_hue, adjust_saturation
c... | retinanet-examples-main | odtk/data.py |
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models import resnet as vrn
from torchvision.models import mobilenet as vmn
from .resnet import ResNet
from .mobilenet import MobileNet
from .utils import register
class FPN(nn.Module):
'Feature Pyramid Network - https://arxiv.org/abs/1612.03... | retinanet-examples-main | odtk/backbones/fpn.py |
import sys
from .resnet import *
from .mobilenet import *
from .fpn import *
| retinanet-examples-main | odtk/backbones/__init__.py |
import torch.nn as nn
from torchvision.models import mobilenet as vmn
import torch.utils.model_zoo as model_zoo
class MobileNet(vmn.MobileNetV2):
'MobileNetV2: Inverted Residuals and Linear Bottlenecks - https://arxiv.org/abs/1801.04381'
def __init__(self, outputs=[18], url=None):
self.stride = 128
... | retinanet-examples-main | odtk/backbones/mobilenet.py |
import torchvision
from torchvision.models import resnet as vrn
import torch.utils.model_zoo as model_zoo
from .utils import register
class ResNet(vrn.ResNet):
'Deep Residual Network - https://arxiv.org/abs/1512.03385'
def __init__(self, layers=[3, 4, 6, 3], bottleneck=vrn.Bottleneck, outputs=[5], groups=1, ... | retinanet-examples-main | odtk/backbones/resnet.py |
import sys
import torchvision
def register(f):
all = sys.modules[f.__module__].__dict__.setdefault('__all__', [])
if f.__name__ in all:
raise RuntimeError('{} already exist!'.format(f.__name__))
all.append(f.__name__)
return f
| retinanet-examples-main | odtk/backbones/utils.py |
import torch
from torch import nn
import torch.nn.functional as F
class FixedBatchNorm2d(nn.Module):
'BatchNorm2d where the batch statistics and the affine parameters are fixed'
def __init__(self, n):
super().__init__()
self.register_buffer("weight", torch.ones(n))
self.register_buffer... | retinanet-examples-main | odtk/backbones/layers.py |
import numpy as np
from odtk.box import generate_anchors, generate_anchors_rotated
# Generates anchors for export.cpp
# ratios = [1.0, 2.0, 0.5]
# scales = [4 * 2 ** (i / 3) for i in range(3)]
ratios = [0.25, 0.5, 1.0, 2.0, 4.0]
scales = [2 * 2**(2 * i/3) for i in range(3)]
angles = [-np.pi / 6, 0, np.pi / 6]
strides... | retinanet-examples-main | extras/cppapi/generate_anchors.py |
#
# Copyright (c) 2019, NVIDIA CORPORATION. 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 applicab... | spark-rapids-examples-main | examples/XGBoost-Examples/main.py |
spark-rapids-examples-main | examples/XGBoost-Examples/agaricus/python/com/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/agaricus/python/com/nvidia/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/agaricus/python/com/nvidia/spark/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/agaricus/python/com/nvidia/spark/examples/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/agaricus/python/com/nvidia/spark/examples/agaricus/__init__.py | |
#
# Copyright (c) 2019-2022, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/agaricus/python/com/nvidia/spark/examples/agaricus/main.py |
spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/nvidia/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/nvidia/spark/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/nvidia/spark/examples/__init__.py | |
#
# Copyright (c) 2019-2021, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/nvidia/spark/examples/taxi/pre_process.py |
spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/nvidia/spark/examples/taxi/__init__.py | |
#
# Copyright (c) 2019-2022, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/nvidia/spark/examples/taxi/consts.py |
#
# Copyright (c) 2019-2022, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/nvidia/spark/examples/taxi/main.py |
#
# Copyright (c) 2019-2021, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/nvidia/spark/examples/taxi/cross_validator_main.py |
#
# Copyright (c) 2019-2022, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/taxi/python/com/nvidia/spark/examples/taxi/etl_main.py |
spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/nvidia/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/nvidia/spark/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/nvidia/spark/examples/__init__.py | |
#
# Copyright (c) 2019-2022, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/nvidia/spark/examples/mortgage/etl.py |
spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/nvidia/spark/examples/mortgage/__init__.py | |
#
# Copyright (c) 2019-2022, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/nvidia/spark/examples/mortgage/consts.py |
#
# Copyright (c) 2019-2022, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/nvidia/spark/examples/mortgage/main.py |
#
# Copyright (c) 2019-2022, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/nvidia/spark/examples/mortgage/cross_validator_main.py |
#
# Copyright (c) 2019-2021, NVIDIA CORPORATION. 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 app... | spark-rapids-examples-main | examples/XGBoost-Examples/mortgage/python/com/nvidia/spark/examples/mortgage/etl_main.py |
spark-rapids-examples-main | examples/XGBoost-Examples/utility/python/com/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/utility/python/com/nvidia/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/utility/python/com/nvidia/spark/__init__.py | |
spark-rapids-examples-main | examples/XGBoost-Examples/utility/python/com/nvidia/spark/examples/__init__.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.