text
stringlengths
5
22M
id
stringlengths
12
177
metadata
dict
__index_level_0__
int64
0
1.37k
#include <ATen/ATen.h> #include <THC/THCAtomics.cuh> #define CUDA_1D_KERNEL_LOOP(i, n) \ for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < n; \ i += blockDim.x * gridDim.x) #define THREADS_PER_BLOCK 1024 inline int GET_BLOCKS(const int N) { int optimal_block_num = (N + THR...
Cream/CDARTS/CDARTS_detection/mmdet/ops/roi_pool/src/roi_pool_kernel.cu/0
{ "file_path": "Cream/CDARTS/CDARTS_detection/mmdet/ops/roi_pool/src/roi_pool_kernel.cu", "repo_id": "Cream", "token_count": 3271 }
300
# -*- coding: utf-8 -*- """ This module defines the :class:`NiceRepr` mixin class, which defines a ``__repr__`` and ``__str__`` method that only depend on a custom ``__nice__`` method, which you must define. This means you only have to overload one function instead of two. Furthermore, if the object defines a ``__len_...
Cream/CDARTS/CDARTS_detection/mmdet/utils/util_mixins.py/0
{ "file_path": "Cream/CDARTS/CDARTS_detection/mmdet/utils/util_mixins.py", "repo_id": "Cream", "token_count": 1532 }
301
json_file: "jsons/big4.json" data_path: "../DATASET/ADEChallengeData2016/" dataset: "coco" det2_cfg: "configs/ADE20K/base.yaml" num_classes: 150 max_iteration: 160000 seed: 12345 random_sample: False eval_flag: True opt: "sgd" opt_eps: 0.001 sched: "new" #"raw for original" epochs: 1000 drop_path_prob: 0.2 image_height...
Cream/CDARTS/CDARTS_segmentation/configs/ade/cydas.yaml/0
{ "file_path": "Cream/CDARTS/CDARTS_segmentation/configs/ade/cydas.yaml", "repo_id": "Cream", "token_count": 313 }
302
# ------------------------------------------------------------------------------ # Loads COCO panoptic dataset. # Written by Bowen Cheng (bcheng9@illinois.edu) # ------------------------------------------------------------------------------ import json import os import numpy as np from .base_dataset import BaseDatas...
Cream/CDARTS/CDARTS_segmentation/dataloaders/segdatasets/coco_panoptic.py/0
{ "file_path": "Cream/CDARTS/CDARTS_segmentation/dataloaders/segdatasets/coco_panoptic.py", "repo_id": "Cream", "token_count": 7871 }
303
from .build import build_segmentation_model_from_cfg
Cream/CDARTS/CDARTS_segmentation/segmentation/model/__init__.py/0
{ "file_path": "Cream/CDARTS/CDARTS_segmentation/segmentation/model/__init__.py", "repo_id": "Cream", "token_count": 16 }
304
from .deeplabv3 import DeepLabV3 from .deeplabv3plus import DeepLabV3Plus from .panoptic_deeplab import PanopticDeepLab
Cream/CDARTS/CDARTS_segmentation/segmentation/model/meta_arch/__init__.py/0
{ "file_path": "Cream/CDARTS/CDARTS_segmentation/segmentation/model/meta_arch/__init__.py", "repo_id": "Cream", "token_count": 47 }
305
# ------------------------------------------------------------------------------ # Reference: https://github.com/facebookresearch/detectron2/blob/master/detectron2/utils/env.py#L15 # Modified by Bowen Cheng (bcheng9@illinois.edu) # ------------------------------------------------------------------------------ import i...
Cream/CDARTS/CDARTS_segmentation/segmentation/utils/env.py/0
{ "file_path": "Cream/CDARTS/CDARTS_segmentation/segmentation/utils/env.py", "repo_id": "Cream", "token_count": 382 }
306
import cv2 import numpy as np import numbers import random import collections def get_2dshape(shape, *, zero=True): if not isinstance(shape, collections.Iterable): shape = int(shape) shape = (shape, shape) else: h, w = map(int, shape) shape = (h, w) if zero: minv = ...
Cream/CDARTS/CDARTS_segmentation/tools/utils/img_utils.py/0
{ "file_path": "Cream/CDARTS/CDARTS_segmentation/tools/utils/img_utils.py", "repo_id": "Cream", "token_count": 2324 }
307
import torch.nn as nn from pdb import set_trace as bp from layers import NaiveSyncBatchNorm BatchNorm2d = NaiveSyncBatchNorm def make_divisible(v, divisor=8, min_value=1): """ forked from slim: https://github.com/tensorflow/models/blob/\ 0344c5503ee55e24f0de7f37336a6e08f10976fd/\ research/slim/net...
Cream/CDARTS/CDARTS_segmentation/train/slimmable_ops.py/0
{ "file_path": "Cream/CDARTS/CDARTS_segmentation/train/slimmable_ops.py", "repo_id": "Cream", "token_count": 1311 }
308
""" Utilities """ import os import torch import torch.nn as nn import torch.nn.functional as F import logging import shutil import torch import torch.distributed as dist import numpy as np def distill(result): result = result.split('\n') cifar10 = result[5].replace(' ', '').split(':') cifar100 = result[7]....
Cream/CDARTS/benchmark201/utils/utils.py/0
{ "file_path": "Cream/CDARTS/benchmark201/utils/utils.py", "repo_id": "Cream", "token_count": 1967 }
309
import torch.nn as nn from lib.models import ops class ModelAug(nn.Module): def __init__(self, feature_extractor, nas_layers, fc_layer, n_nodes=4, aux_head=None): """ args: """ super(ModelAug, self).__init__() self.feature_extractor = feature_extractor self.nas_l...
Cream/CDARTS/lib/models/model_augment.py/0
{ "file_path": "Cream/CDARTS/lib/models/model_augment.py", "repo_id": "Cream", "token_count": 898 }
310
AUTO_RESUME: False DATA_DIR: './data/imagenet' MODEL: '112m_retrain' RESUME_PATH: './experiments/workspace/retrain/resume.pth.tar' SAVE_PATH: './experiments/workspace/retrain' SEED: 42 LOG_INTERVAL: 50 RECOVERY_INTERVAL: 0 WORKERS: 8 NUM_GPU: 8 SAVE_IMAGES: False AMP: False OUTPUT: 'None' EVAL_METRICS: 'prec1' TTA: 0 L...
Cream/Cream/experiments/configs/retrain/114.yaml/0
{ "file_path": "Cream/Cream/experiments/configs/retrain/114.yaml", "repo_id": "Cream", "token_count": 442 }
311
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Written by Hao Du and Houwen Peng # email: haodu8-c@my.cityu.edu.hk and houwen.peng@microsoft.com import time import torch from collections import OrderedDict from lib.utils.util import AverageMeter, accuracy, reduce_tensor # validate functio...
Cream/Cream/lib/core/test.py/0
{ "file_path": "Cream/Cream/lib/core/test.py", "repo_id": "Cream", "token_count": 1762 }
312
yacs numpy==1.17 opencv-python==4.0.1.24 torchvision==0.2.1 thop git+https://github.com/sovrasov/flops-counter.pytorch.git pillow==6.1.0 torch==1.2 timm==0.1.20 tensorboardx==1.2 tensorboard future
Cream/Cream/requirements/0
{ "file_path": "Cream/Cream/requirements", "repo_id": "Cream", "token_count": 98 }
313
# -------------------------------------------------------- # EfficientViT Model Architecture for Downstream Tasks # Copyright (c) 2022 Microsoft # Written by: Xinyu Liu # -------------------------------------------------------- import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkp...
Cream/EfficientViT/downstream/efficientvit.py/0
{ "file_path": "Cream/EfficientViT/downstream/efficientvit.py", "repo_id": "Cream", "token_count": 10995 }
314
import os import json from torchvision import datasets, transforms from torchvision.datasets.folder import ImageFolder, default_loader from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from timm.data import create_transform class INatDataset(ImageFolder): def __init__(self, root, train...
Cream/MiniViT/Mini-DeiT/datasets.py/0
{ "file_path": "Cream/MiniViT/Mini-DeiT/datasets.py", "repo_id": "Cream", "token_count": 1890 }
315
import torch class SubsetRandomSampler(torch.utils.data.Sampler): r"""Samples elements randomly from a given list of indices, without replacement. Arguments: indices (sequence): a sequence of indices """ def __init__(self, indices): self.epoch = 0 self.indices = indices ...
Cream/MiniViT/Mini-Swin/data/samplers.py/0
{ "file_path": "Cream/MiniViT/Mini-Swin/data/samplers.py", "repo_id": "Cream", "token_count": 209 }
316
# MiniViT: Compressing Vision Transformers with Weight Multiplexing :sunny: Hiring research interns for neural architecture search, tiny transformer design, model compression projects: houwen.peng@microsoft.com. **This is an official implementation of [MiniViT](https://openaccess.thecvf.com/content/CVPR2022/html/Zhan...
Cream/MiniViT/README.md/0
{ "file_path": "Cream/MiniViT/README.md", "repo_id": "Cream", "token_count": 1700 }
317
""" CLIP Model Adapted from https://github.com/openai/CLIP. Originally MIT License, Copyright (c) 2021 OpenAI. """ import functools import inspect from copy import deepcopy import os import random import copy from contextlib import nullcontext from argparse import Namespace from dataclasses import dataclass import f...
Cream/TinyCLIP/src/open_clip/model.py/0
{ "file_path": "Cream/TinyCLIP/src/open_clip/model.py", "repo_id": "Cream", "token_count": 27603 }
318
from itertools import repeat import collections.abc from torch import nn as nn from torchvision.ops.misc import FrozenBatchNorm2d def freeze_batch_norm_2d(module, module_match={}, name=''): """ Converts all `BatchNorm2d` and `SyncBatchNorm` layers of provided module into `FrozenBatchNorm2d`. If `module` is ...
Cream/TinyCLIP/src/open_clip/utils.py/0
{ "file_path": "Cream/TinyCLIP/src/open_clip/utils.py", "repo_id": "Cream", "token_count": 950 }
319
import json import logging import math import os import psutil import functools import time from collections import defaultdict import numpy as np import torch from torch import optim import torch.nn.functional as F from timm.utils import get_state_dict from torch.utils.data._utils.collate import default_collate from ...
Cream/TinyCLIP/src/training/train.py/0
{ "file_path": "Cream/TinyCLIP/src/training/train.py", "repo_id": "Cream", "token_count": 16617 }
320
MODEL: NAME: TinyViT-11M-22kto1k TYPE: tiny_vit DROP_PATH_RATE: 0.0 TINY_VIT: DEPTHS: [ 2, 2, 6, 2 ] NUM_HEADS: [ 2, 4, 8, 14 ] WINDOW_SIZES: [ 7, 7, 14, 7 ] EMBED_DIMS: [64, 128, 256, 448] TRAIN: EPOCHS: 30 WARMUP_EPOCHS: 5 BASE_LR: 2.5e-4 WEIGHT_DECAY: 1e-8 MIN_LR: 1e-5 LAYER_L...
Cream/TinyViT/configs/22kto1k/tiny_vit_11m_22kto1k.yaml/0
{ "file_path": "Cream/TinyViT/configs/22kto1k/tiny_vit_11m_22kto1k.yaml", "repo_id": "Cream", "token_count": 243 }
321
import os import multiprocessing import torch import torch.distributed as dist import numpy as np from .aug_random import AugRandomContext from .manager import TxtManager def get_rank(): if not dist.is_available() or not dist.is_initialized(): return 0 return dist.get_rank() class DatasetWrapper(tor...
Cream/TinyViT/data/augmentation/dataset_wrapper.py/0
{ "file_path": "Cream/TinyViT/data/augmentation/dataset_wrapper.py", "repo_id": "Cream", "token_count": 1448 }
322
""" Tensorflow Preprocessing Adapter Allows use of Tensorflow preprocessing pipeline in PyTorch Transform Copyright of original Tensorflow code below. Hacked together by / Copyright 2020 Ross Wightman """ # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2....
Cream/TinyViT/data/augmentation/tf_preprocessing.py/0
{ "file_path": "Cream/TinyViT/data/augmentation/tf_preprocessing.py", "repo_id": "Cream", "token_count": 3751 }
323
from .build import build_model
Cream/TinyViT/models/__init__.py/0
{ "file_path": "Cream/TinyViT/models/__init__.py", "repo_id": "Cream", "token_count": 8 }
324
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved """ COCO dataset which returns image_id for evaluation. Mostly copy-paste from https://github.com/pytorch/vision/blob/13b35ff/references/detection/coco_utils.py """ from pathlib import Path from typing import List, Any import torch import torch.ut...
Cream/iRPE/DETR-with-iRPE/datasets/coco.py/0
{ "file_path": "Cream/iRPE/DETR-with-iRPE/datasets/coco.py", "repo_id": "Cream", "token_count": 3082 }
325
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved """ This file provides the definition of the convolutional heads used to predict masks, as well as the losses """ import io from collections import defaultdict from typing import List, Optional import torch import torch.nn as nn import torch.nn.fun...
Cream/iRPE/DETR-with-iRPE/models/segmentation.py/0
{ "file_path": "Cream/iRPE/DETR-with-iRPE/models/segmentation.py", "repo_id": "Cream", "token_count": 7422 }
326
from .build import build_dataloader from .imagenet.real_labels import RealLabelsImagenet
CvT/lib/dataset/__init__.py/0
{ "file_path": "CvT/lib/dataset/__init__.py", "repo_id": "CvT", "token_count": 29 }
327
from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import timedelta from pathlib import Path import os import logging import shutil import time import tensorwatch as tw import torch import torch.backends.cudnn as cudnn from utils.comm import co...
CvT/lib/utils/utils.py/0
{ "file_path": "CvT/lib/utils/utils.py", "repo_id": "CvT", "token_count": 3469 }
328
import sys sys.path.append('../') import unittest import numpy as np import pandas as pd import shutil import os import invoker class TestErrorInput(unittest.TestCase): def setUp(self): self.__input_path = './functional_test_input_folder' self.__input_csv_file = './functional_test_input_file.csv'...
anomalydetector/aml_component/tests/test_functionality.py/0
{ "file_path": "anomalydetector/aml_component/tests/test_functionality.py", "repo_id": "anomalydetector", "token_count": 5055 }
329
""" Copyright (C) Microsoft Corporation. All rights reserved.​ ​ Microsoft Corporation ("Microsoft") grants you a nonexclusive, perpetual, royalty-free right to use, copy, and modify the software code provided by us ("Software Code"). You may not sublicense the Software Code or any use of it (except to your affiliates...
anomalydetector/srcnn/train.py/0
{ "file_path": "anomalydetector/srcnn/train.py", "repo_id": "anomalydetector", "token_count": 1317 }
330
Archai
archai/.vscode/spellright.dict/0
{ "file_path": "archai/.vscode/spellright.dict", "repo_id": "archai", "token_count": 3 }
331
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Dict, Union, Optional, Any from pathlib import Path from azure.ai.ml import MLClient from azure.ai.ml.entities import AmlCompute, Environment from azure.identity import DefaultAzureCredential def get_aml_client_from_file(conf...
archai/archai/common/azureml_helper.py/0
{ "file_path": "archai/archai/common/azureml_helper.py", "repo_id": "archai", "token_count": 2105 }
332
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from __future__ import annotations import gc import timeit from types import TracebackType from typing import Optional class MeasureBlockTime: """Context manager that measures the time elapsed in a block of code.""" def __init__(self,...
archai/archai/common/timing.py/0
{ "file_path": "archai/archai/common/timing.py", "repo_id": "archai", "token_count": 559 }
333
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import glob import os from typing import Optional, Tuple import numpy as np import torch from archai.common.file_utils import get_full_path from archai.common.ordered_dict_logger import OrderedDictLogger from archai.datasets.nlp.tokenizer_utils...
archai/archai/datasets/nlp/nvidia_dataset_provider_utils.py/0
{ "file_path": "archai/archai/datasets/nlp/nvidia_dataset_provider_utils.py", "repo_id": "archai", "token_count": 4171 }
334
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Any, Dict, Optional class ArchaiModel: """Model wrapper with an architecture identifier and an optional metadata dictionary.""" def __init__(self, arch: Any, archid: str, metadata: Optional[Dict[str, Any]] = None): ...
archai/archai/discrete_search/api/archai_model.py/0
{ "file_path": "archai/archai/discrete_search/api/archai_model.py", "repo_id": "archai", "token_count": 489 }
335
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Any, Callable, Dict, List, Optional, Tuple, Union import ray from overrides import overrides from archai.api.dataset_provider import DatasetProvider from archai.discrete_search.api.archai_model import ArchaiModel from archai....
archai/archai/discrete_search/evaluators/progressive_training.py/0
{ "file_path": "archai/archai/discrete_search/evaluators/progressive_training.py", "repo_id": "archai", "token_count": 2288 }
336
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import math from random import Random from numbers import Number from typing import Any, List, Union, Optional class DiscreteChoice: def __init__(self, choices: List[Union[int, float, str]], probabilities: Optional[List[flo...
archai/archai/discrete_search/search_spaces/config/discrete_choice.py/0
{ "file_path": "archai/archai/discrete_search/search_spaces/config/discrete_choice.py", "repo_id": "archai", "token_count": 1106 }
337
import math import os from dataclasses import dataclass from typing import Optional, Tuple, Union, Any import torch import torch.utils.checkpoint from torch import nn from torch.cuda.amp import autocast from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss from transformers.modeling_outputs import ( B...
archai/archai/discrete_search/search_spaces/nlp/tfpp/backbones/gpt2/block.py/0
{ "file_path": "archai/archai/discrete_search/search_spaces/nlp/tfpp/backbones/gpt2/block.py", "repo_id": "archai", "token_count": 2113 }
338
# Modified from S4: https://github.com/HazyResearch/state-spaces/blob/main/src/models/sequence/ss/s4.py from functools import partial import math import torch import torch.nn as nn import torch.nn.functional as F from transformers import PretrainedConfig from einops import rearrange, repeat import opt_einsum as oe fr...
archai/archai/discrete_search/search_spaces/nlp/tfpp/ops/sgconv3.py/0
{ "file_path": "archai/archai/discrete_search/search_spaces/nlp/tfpp/ops/sgconv3.py", "repo_id": "archai", "token_count": 8190 }
339
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Any, List, Optional from transformers.models.gpt2.configuration_gpt2 import GPT2Config def _map_to_list(variable: Any, size: int) -> List[Any]: if isinstance(variable, list): size_diff = size - len(variable) ...
archai/archai/discrete_search/search_spaces/nlp/transformer_flex/models/configuration_gpt2_flex.py/0
{ "file_path": "archai/archai/discrete_search/search_spaces/nlp/transformer_flex/models/configuration_gpt2_flex.py", "repo_id": "archai", "token_count": 454 }
340
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Any, Optional, Tuple from transformers.configuration_utils import PretrainedConfig from archai.onnx.config_utils.onnx_config_base import OnnxConfigWithPast class CodeGenOnnxConfig(OnnxConfigWithPast): """CodeGen ONNX co...
archai/archai/onnx/config_utils/codegen_onnx_config.py/0
{ "file_path": "archai/archai/onnx/config_utils/codegen_onnx_config.py", "repo_id": "archai", "token_count": 353 }
341
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import torch class OnnxDynamicObserver: """DynamicObserver that is compliant with ONNX-based graphs. This class can be used to perform symmetric or assymetric quantization, depending on the `dtype` provided. `qint8` is usually used...
archai/archai/quantization/observers.py/0
{ "file_path": "archai/archai/quantization/observers.py", "repo_id": "archai", "token_count": 791 }
342
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from overrides import overrides from archai.supergraph.algos.darts.darts_model_desc_builder import DartsModelDescBuilder from archai.supergraph.algos.didarts.didarts_arch_trainer import DidartsArchTrainer from archai.supergraph.nas.arch_trainer ...
archai/archai/supergraph/algos/didarts/didarts_exp_runner.py/0
{ "file_path": "archai/archai/supergraph/algos/didarts/didarts_exp_runner.py", "repo_id": "archai", "token_count": 212 }
343
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Iterator, Optional, Tuple import torch from overrides import overrides from torch import Tensor, nn from archai.common.utils import zip_eq from archai.supergraph.nas.arch_params import ArchParams from archai.supergraph.nas.mo...
archai/archai/supergraph/algos/gumbelsoftmax/gs_op.py/0
{ "file_path": "archai/archai/supergraph/algos/gumbelsoftmax/gs_op.py", "repo_id": "archai", "token_count": 2271 }
344
# Copyright 2019 The Google Research 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 agree...
archai/archai/supergraph/algos/nasbench101/nasbench101_dataset.py/0
{ "file_path": "archai/archai/supergraph/algos/nasbench101/nasbench101_dataset.py", "repo_id": "archai", "token_count": 2179 }
345
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from overrides import overrides from archai.supergraph.algos.xnas.xnas_arch_trainer import XnasArchTrainer from archai.supergraph.algos.xnas.xnas_model_desc_builder import XnasModelDescBuilder from archai.supergraph.nas.arch_trainer import TArch...
archai/archai/supergraph/algos/xnas/xnas_exp_runner.py/0
{ "file_path": "archai/archai/supergraph/algos/xnas/xnas_exp_runner.py", "repo_id": "archai", "token_count": 211 }
346
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os import torchvision from overrides import overrides from torchvision.transforms import transforms from archai.common import utils from archai.common.config import Config from archai.supergraph.datasets.dataset_provider import ( Dat...
archai/archai/supergraph/datasets/providers/flower102_provider.py/0
{ "file_path": "archai/archai/supergraph/datasets/providers/flower102_provider.py", "repo_id": "archai", "token_count": 1099 }
347
import math import torch import torch.nn as nn from archai.supergraph.models.shakedrop import ShakeDrop def conv3x3(in_planes, out_planes, stride=1): """ 3x3 convolution with padding """ return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) class BasicBlock(n...
archai/archai/supergraph/models/pyramidnet.py/0
{ "file_path": "archai/archai/supergraph/models/pyramidnet.py", "repo_id": "archai", "token_count": 4758 }
348
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import List, Optional import torch from overrides import overrides from torch import nn from archai.supergraph.nas.arch_module import ArchModule from archai.supergraph.nas.model_desc import EdgeDesc from archai.supergraph.nas.operat...
archai/archai/supergraph/nas/dag_edge.py/0
{ "file_path": "archai/archai/supergraph/nas/dag_edge.py", "repo_id": "archai", "token_count": 563 }
349
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os import weakref from collections import UserDict from typing import Callable import torch from archai.common import utils from archai.common.config import Config _CallbackType = Callable #[['CheckPoint', *kargs: Any, **kwargs: Any], N...
archai/archai/supergraph/utils/checkpoint.py/0
{ "file_path": "archai/archai/supergraph/utils/checkpoint.py", "repo_id": "archai", "token_count": 1015 }
350
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import json import os from dataclasses import asdict, dataclass, field from typing import Any, Dict, Union import deepspeed import torch from archai.common.file_utils import get_full_path @dataclass class DsTrainingArguments: """Define ar...
archai/archai/trainers/nlp/ds_training_args.py/0
{ "file_path": "archai/archai/trainers/nlp/ds_training_args.py", "repo_id": "archai", "token_count": 1320 }
351
__include__: "darts.yaml" # just use darts defaults common: log_level: 20 # logging.INFO nas: eval: model_desc: params: { 'cell_matrix' : [[0, 1, 1, 1, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1], ...
archai/confs/algos/nasbench101.yaml/0
{ "file_path": "archai/confs/algos/nasbench101.yaml", "repo_id": "archai", "token_count": 810 }
352
__include__: './dataroot.yaml' # default dataset settings are for cifar dataset: name: 'flower102' n_classes: 102 channels: 3 # number of channels in image max_batches: -1 # if >= 0 then only these many batches are generated (useful for debugging) storage_name: 'flower102' # name of folder or tar file to cop...
archai/confs/datasets/flower102.yaml/0
{ "file_path": "archai/confs/datasets/flower102.yaml", "repo_id": "archai", "token_count": 102 }
353
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license # Root image to be based # Available images: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch/tags FROM nvcr.io/nvidia/pytorch:23.02-py3 # Labels for the docker LABEL description="NVIDIA Docker with Archai, DeepSpeed and Flash-Attent...
archai/docker/Dockerfile.flash/0
{ "file_path": "archai/docker/Dockerfile.flash", "repo_id": "archai", "token_count": 666 }
354
Discrete Search =============== .. toctree:: :maxdepth: 2 Search Spaces <discrete_search/search_space.ipynb> Evaluators <discrete_search/evaluators.ipynb> Algorithms <discrete_search/algos.ipynb> Configuration-based Search <discrete_search/config_search.ipynb>
archai/docs/getting_started/notebooks/discrete_search.rst/0
{ "file_path": "archai/docs/getting_started/notebooks/discrete_search.rst", "repo_id": "archai", "token_count": 101 }
355
<jupyter_start><jupyter_text>Exporting Models to ONNXExporting a pre-trained model to ONNX involves converting the model into a common format that can be easily integrated and deployed across different platforms. The conversion can be done using a tool or library, which converts the model's architecture, weights, and c...
archai/docs/getting_started/notebooks/nlp/onnx_export.ipynb/0
{ "file_path": "archai/docs/getting_started/notebooks/nlp/onnx_export.ipynb", "repo_id": "archai", "token_count": 1065 }
356
Search Algorithms ================= BANANAS ------- .. automodule:: archai.discrete_search.algos.bananas :members: :undoc-members: Evolution Pareto ---------------- .. automodule:: archai.discrete_search.algos.evolution_pareto :members: :undoc-members: Local Search ------------ .. automodule:: archai....
archai/docs/reference/api/archai.discrete_search.algos.rst/0
{ "file_path": "archai/docs/reference/api/archai.discrete_search.algos.rst", "repo_id": "archai", "token_count": 276 }
357
Utilities ========= Multi-Objective --------------- .. automodule:: archai.discrete_search.utils.multi_objective :members: :undoc-members:
archai/docs/reference/api/archai.discrete_search.utils.rst/0
{ "file_path": "archai/docs/reference/api/archai.discrete_search.utils.rst", "repo_id": "archai", "token_count": 50 }
358
Providers ========= Aicraft ------- .. automodule:: archai.supergraph.datasets.providers.aircraft_provider :members: :undoc-members: CIFAR-100 --------- .. automodule:: archai.supergraph.datasets.providers.cifar100_provider :members: :undoc-members: CIFAR-10 -------- .. automodule:: archai.supergraph....
archai/docs/reference/api/archai.supergraph.datasets.providers.rst/0
{ "file_path": "archai/docs/reference/api/archai.supergraph.datasets.providers.rst", "repo_id": "archai", "token_count": 684 }
359
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. [pytest] addopts=-vv --durations=10 # Do not run tests in the build folder norecursedirs=build # Warnings to be ignored filterwarnings= ignore::DeprecationWarning ignore::UserWarning ignore::torch.jit.TracerWarning
archai/pytest.ini/0
{ "file_path": "archai/pytest.ini", "repo_id": "archai", "token_count": 98 }
360
<jupyter_start><jupyter_text>How-To Evaluate Models with LM-Eval HarnessThe `lm_eval_harness` research project implements a wrapper over the `lm_eval` framework, provided by EleutherAI. It is designed to make it easy to evaluate NLP models and compare their performance. In this tutorial, we will walk through the proces...
archai/research/lm_eval_harness/tutorials/simple_evaluation.ipynb/0
{ "file_path": "archai/research/lm_eval_harness/tutorials/simple_evaluation.ipynb", "repo_id": "archai", "token_count": 1082 }
361
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. """ Script to prepare food101 dataset for pytorch dataloader. This script assumes that one has downloaded and extracted the full food101 dataset from ETHZ. Invoke the script as $ python food101.py --rootdir /path/to/food101. It will create 'trai...
archai/scripts/supergraph/download_datasets/food101_install.py/0
{ "file_path": "archai/scripts/supergraph/download_datasets/food101_install.py", "repo_id": "archai", "token_count": 1092 }
362
import logging import random from archai.supergraph.algos.nasbench101 import model_builder from archai.supergraph.algos.nasbench101.nasbench101_dataset import Nasbench101Dataset def main(): logging.getLogger().setLevel(logging.DEBUG) # create dataset nsds = Nasbench101Dataset("~/dataroot/nasbench_ds/nas...
archai/scripts/supergraph/nasbench101/query_test.py/0
{ "file_path": "archai/scripts/supergraph/nasbench101/query_test.py", "repo_id": "archai", "token_count": 506 }
363
import argparse import csv def read_status(filename): header = None with open(filename, 'r') as f: reader = csv.reader(f, delimiter=',') for row in reader: header = [x.strip() for x in row] break result = {} with open(filename, 'r') as f: reader = csv.Di...
archai/tasks/face_segmentation/aml/azure/compare_status.py/0
{ "file_path": "archai/tasks/face_segmentation/aml/azure/compare_status.py", "repo_id": "archai", "token_count": 847 }
364
apiVersion: apps/v1 kind: Deployment metadata: name: snpe-quantizer namespace: snpe spec: replicas: 1 selector: matchLabels: app: snpe-quantizer template: metadata: labels: app: snpe-quantizer spec: affinity: # See https://kubernetes.io/docs/concepts/scheduling-ev...
archai/tasks/face_segmentation/aml/docker/quantizer/quantizer.template.yaml/0
{ "file_path": "archai/tasks/face_segmentation/aml/docker/quantizer/quantizer.template.yaml", "repo_id": "archai", "token_count": 615 }
365
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Any, Dict, List, Optional, Tuple, Union from overrides import overrides from archai.discrete_search.evaluators import AvgOnnxLatency from archai.discrete_search.api.archai_model import ArchaiModel from archai.common.store import...
archai/tasks/face_segmentation/aml/training/onnx_latency.py/0
{ "file_path": "archai/tasks/face_segmentation/aml/training/onnx_latency.py", "repo_id": "archai", "token_count": 1085 }
366
import os import numpy as np import tempfile import uuid from archai.common.store import ArchaiStore CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING' def test_store(): con_str = os.getenv(CONNECTION_NAME) if not con_str: print(f"Skipping test_store because you have no {CONNECTION_NAME} environment...
archai/tests/common/test_store.py/0
{ "file_path": "archai/tests/common/test_store.py", "repo_id": "archai", "token_count": 990 }
367
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os import pytest from archai.discrete_search.algos.bananas import MoBananasSearch @pytest.fixture(scope="session") def output_dir(tmp_path_factory): return tmp_path_factory.mktemp("out_bananas") def test_bananas(output_dir, searc...
archai/tests/discrete_search/algos/test_bananas.py/0
{ "file_path": "archai/tests/discrete_search/algos/test_bananas.py", "repo_id": "archai", "token_count": 441 }
368
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Callable from archai.discrete_search.evaluators.functional import EvaluationFunction def test_evaluation_function(): evaluator = EvaluationFunction(lambda a, b: 1) # Assert that evaluator can evaluate the argument f...
archai/tests/discrete_search/evaluators/test_functional.py/0
{ "file_path": "archai/tests/discrete_search/evaluators/test_functional.py", "repo_id": "archai", "token_count": 131 }
369
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os from transformers import GPT2Config, GPT2LMHeadModel from archai.onnx.config_utils.onnx_config_base import OnnxConfig from archai.onnx.export import export_to_onnx def test_export_to_onnx(): model = GPT2LMHeadModel(config=GPT2Co...
archai/tests/onnx/test_export.py/0
{ "file_path": "archai/tests/onnx/test_export.py", "repo_id": "archai", "token_count": 396 }
370
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Callable import torch from archai.common.common import common_init from archai.supergraph.nas.model import Model from archai.supergraph.nas.model_desc_builder import ModelDescBuilder def requires_gpu(test_fn: Callable): ...
archai/tests/supergraph/test_zero_model.py/0
{ "file_path": "archai/tests/supergraph/test_zero_model.py", "repo_id": "archai", "token_count": 493 }
371
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
azure-devops-python-api/azure-devops/azure/devops/released/member_entitlement_management/member_entitlement_management_client.py/0
{ "file_path": "azure-devops-python-api/azure-devops/azure/devops/released/member_entitlement_management/member_entitlement_management_client.py", "repo_id": "azure-devops-python-api", "token_count": 7781 }
372
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
azure-devops-python-api/azure-devops/azure/devops/released/project_analysis/project_analysis_client.py/0
{ "file_path": "azure-devops-python-api/azure-devops/azure/devops/released/project_analysis/project_analysis_client.py", "repo_id": "azure-devops-python-api", "token_count": 2576 }
373
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
azure-devops-python-api/azure-devops/azure/devops/v7_0/test/test_client.py/0
{ "file_path": "azure-devops-python-api/azure-devops/azure/devops/v7_0/test/test_client.py", "repo_id": "azure-devops-python-api", "token_count": 30090 }
374
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
azure-devops-python-api/azure-devops/azure/devops/v7_1/elastic/elastic_client.py/0
{ "file_path": "azure-devops-python-api/azure-devops/azure/devops/v7_1/elastic/elastic_client.py", "repo_id": "azure-devops-python-api", "token_count": 3821 }
375
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
azure-devops-python-api/azure-devops/azure/devops/v7_1/file_container/models.py/0
{ "file_path": "azure-devops-python-api/azure-devops/azure/devops/v7_1/file_container/models.py", "repo_id": "azure-devops-python-api", "token_count": 3418 }
376
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
azure-devops-python-api/azure-devops/azure/devops/v7_1/location/models.py/0
{ "file_path": "azure-devops-python-api/azure-devops/azure/devops/v7_1/location/models.py", "repo_id": "azure-devops-python-api", "token_count": 7645 }
377
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
azure-devops-python-api/azure-devops/azure/devops/v7_1/profile/models.py/0
{ "file_path": "azure-devops-python-api/azure-devops/azure/devops/v7_1/profile/models.py", "repo_id": "azure-devops-python-api", "token_count": 3848 }
378
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
azure-devops-python-api/azure-devops/azure/devops/v7_1/release/release_client.py/0
{ "file_path": "azure-devops-python-api/azure-devops/azure/devops/v7_1/release/release_client.py", "repo_id": "azure-devops-python-api", "token_count": 22851 }
379
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
azure-devops-python-api/azure-devops/azure/devops/v7_1/test_plan/test_plan_client.py/0
{ "file_path": "azure-devops-python-api/azure-devops/azure/devops/v7_1/test_plan/test_plan_client.py", "repo_id": "azure-devops-python-api", "token_count": 24015 }
380
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
azure-devops-python-api/azure-devops/setup.py/0
{ "file_path": "azure-devops-python-api/azure-devops/setup.py", "repo_id": "azure-devops-python-api", "token_count": 536 }
381
# Contributing to Azure-Quantum-Python # If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](https://opensource.microsoft.com/collaborate/). ## Pre-requisites Install pre-reqs: ```bash pip install azure_devto...
azure-quantum-python/CONTRIBUTING.md/0
{ "file_path": "azure-quantum-python/CONTRIBUTING.md", "repo_id": "azure-quantum-python", "token_count": 1194 }
382
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
azure-quantum-python/azure-quantum/azure/quantum/_client/__init__.py/0
{ "file_path": "azure-quantum-python/azure-quantum/azure/quantum/_client/__init__.py", "repo_id": "azure-quantum-python", "token_count": 227 }
383
## # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. ## """Defines argument types for Microsoft Estimator""" from .types import EmptyArray, Pauli, Range, Result __all__ = ['EmptyArray', 'Pauli', 'Range', 'Result']
azure-quantum-python/azure-quantum/azure/quantum/argument_types/__init__.py/0
{ "file_path": "azure-quantum-python/azure-quantum/azure/quantum/argument_types/__init__.py", "repo_id": "azure-quantum-python", "token_count": 73 }
384
## # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. ## import abc from typing import TYPE_CHECKING, Union from azure.quantum._client.models import ItemDetails, ItemType, SessionDetails, JobDetails if TYPE_CHECKING: from azure.quantum.workspace import Workspace __all_...
azure-quantum-python/azure-quantum/azure/quantum/job/workspace_item.py/0
{ "file_path": "azure-quantum-python/azure-quantum/azure/quantum/job/workspace_item.py", "repo_id": "azure-quantum-python", "token_count": 466 }
385
## # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. ## from typing import Any, Dict, List from warnings import warn from azure.quantum.target.target import ( Target, _determine_shots_or_deprecated_num_shots, ) from azure.quantum.job.job import Job from azure.quantum...
azure-quantum-python/azure-quantum/azure/quantum/target/ionq.py/0
{ "file_path": "azure-quantum-python/azure-quantum/azure/quantum/target/ionq.py", "repo_id": "azure-quantum-python", "token_count": 3875 }
386
"""Defines targets and helper functions for the Rigetti provider""" ## # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. ## __all__ = [ "InputParams", "Rigetti", "RigettiTarget", ] from dataclasses import dataclass from enum import Enum from typing import Union...
azure-quantum-python/azure-quantum/azure/quantum/target/rigetti/target.py/0
{ "file_path": "azure-quantum-python/azure-quantum/azure/quantum/target/rigetti/target.py", "repo_id": "azure-quantum-python", "token_count": 3042 }
387
## # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## # Physical resource estimation for RSA using a pre-compiled QIR code import argparse import os from azure.quantum import Workspace from azure.quantum.target.microsoft import MicrosoftEstimator, QubitParams, \ QECScheme # Configure pro...
azure-quantum-python/azure-quantum/examples/resource_estimation/rsa.py/0
{ "file_path": "azure-quantum-python/azure-quantum/examples/resource_estimation/rsa.py", "repo_id": "azure-quantum-python", "token_count": 1230 }
388
60 O 97.873900000 103.017000000 100.816000000 H 98.128600000 103.038000000 99.848800000 H 97.173800000 102.317000000 100.960000000 O 100.645000000 100.169000000 95.891500000 H 101.491000000 100.305000000 96.406200000 H 99.888700000 100.618000000 96.36780000...
azure-quantum-python/azure-quantum/tests/unit/molecule.xyz/0
{ "file_path": "azure-quantum-python/azure-quantum/tests/unit/molecule.xyz", "repo_id": "azure-quantum-python", "token_count": 1574 }
389
## # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. ## from typing import Any, Dict, List, Tuple, Union import unittest import warnings import random import json import pytest import numpy as np import collections from qiskit import QuantumCircuit, QuantumRegister, Classica...
azure-quantum-python/azure-quantum/tests/unit/test_qiskit.py/0
{ "file_path": "azure-quantum-python/azure-quantum/tests/unit/test_qiskit.py", "repo_id": "azure-quantum-python", "token_count": 28220 }
390
--- page_type: sample author: alchocro description: Running your first job on the Azure Quantum service ms.author: alchocro@microsoft.com ms.date: 08/08/2022 languages: - python - qsharp products: - azure-quantum --- # Running your first job on the Azure Quantum service These are Azure Quantum sample notebooks that i...
azure-quantum-python/samples/hello-world/README.md/0
{ "file_path": "azure-quantum-python/samples/hello-world/README.md", "repo_id": "azure-quantum-python", "token_count": 800 }
391
# Visualization This folder contains visualizations for the resource estimation feature. - react-lib: source code for the visualization components and D3 integration. - js-lib: wrapper JavaScript library which packages the visualization components into a consumable JavaScript package by clients. Refer to **build** f...
azure-quantum-python/visualization/README.md/0
{ "file_path": "azure-quantum-python/visualization/README.md", "repo_id": "azure-quantum-python", "token_count": 147 }
392
/*------------------------------------ Copyright (c) Microsoft Corporation. Licensed under the MIT License. All rights reserved. ------------------------------------ */ import * as React from "react"; import * as d3 from "d3"; import * as d3Format from "d3-format"; import { PieArcDatum } from "d3-shape"; import ...
azure-quantum-python/visualization/react-lib/src/components/d3-visualization-components/DonutChart.tsx/0
{ "file_path": "azure-quantum-python/visualization/react-lib/src/components/d3-visualization-components/DonutChart.tsx", "repo_id": "azure-quantum-python", "token_count": 2275 }
393
/*------------------------------------ Copyright (c) Microsoft Corporation. Licensed under the MIT License. All rights reserved. ------------------------------------ */ export interface JobResults { errorBudget: ErrorBudget; jobParams: JobParams; logicalCounts: LogicalCounts; logicalQubit: LogicalQubit; ...
azure-quantum-python/visualization/react-lib/src/models/JobResults.ts/0
{ "file_path": "azure-quantum-python/visualization/react-lib/src/models/JobResults.ts", "repo_id": "azure-quantum-python", "token_count": 716 }
394
JavaScript ========== .. toctree:: BiString BiStringBuilder Alignment Tokenization Tokenizer
bistring/docs/JavaScript/index.rst/0
{ "file_path": "bistring/docs/JavaScript/index.rst", "repo_id": "bistring", "token_count": 44 }
395
/*! * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT license. */ import { BiString, Alignment } from ".."; test("new BiString", () => { expect(() => new BiString(42 as any)).toThrow(TypeError); expect(() => new BiString("fourty-two", 42 as any)).toThrow(TypeError); e...
bistring/js/tests/bistring.test.ts/0
{ "file_path": "bistring/js/tests/bistring.test.ts", "repo_id": "bistring", "token_count": 5482 }
396
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. from __future__ import annotations __all__ = [ 'Token', 'Tokenization', 'Tokenizer', 'RegexTokenizer', 'SplittingTokenizer', 'CharacterTokenizer', 'WordTokenizer', 'SentenceTokenizer', ] from...
bistring/python/bistring/_token.py/0
{ "file_path": "bistring/python/bistring/_token.py", "repo_id": "bistring", "token_count": 6058 }
397
default_stages: [push] repos: - repo: https://github.com/pre-commit/mirrors-pylint rev: v2.4.3 hooks: - id: pylint files: libraries args: [--rcfile=.pylintrc] verbose: true
botbuilder-python/.pre-commit-config.yaml/0
{ "file_path": "botbuilder-python/.pre-commit-config.yaml", "repo_id": "botbuilder-python", "token_count": 108 }
398
# CoreBot Bot Framework v4 core bot sample. This bot has been created using [Bot Framework](https://dev.botframework.com), it shows how to: - Use [LUIS](https://www.luis.ai) to implement core AI capabilities - Implement a multi-turn conversation using Dialogs - Handle user interruptions for such things as `Help` or ...
botbuilder-python/generators/app/templates/core/{{cookiecutter.bot_name}}/README.md/0
{ "file_path": "botbuilder-python/generators/app/templates/core/{{cookiecutter.bot_name}}/README.md", "repo_id": "botbuilder-python", "token_count": 928 }
399