text stringlengths 5 22M | id stringlengths 12 177 | metadata dict | __index_level_0__ int64 0 1.37k |
|---|---|---|---|
import subprocess
import argparse
import os, sys, time
import torch
from parameters16g_es_corpusb import *
## Xinyu: Copied from run_hf.sh, remember to change CUDA_VISIBLE_DEVICES & nproc_per_node
# --model_name_or_path $1 \
# --output_dir $2 \
# --data_dir $3 \
# --train_file $4 \
# --validation_file $5 \
# --pad_to_... | ContextualSP/logigan/pre-training/launcher_es.py/0 | {
"file_path": "ContextualSP/logigan/pre-training/launcher_es.py",
"repo_id": "ContextualSP",
"token_count": 2366
} | 243 |
(('Who', '?x#a#ns:people.person'), 51406)
(('star', '?x#ns:film.actor.film/ns:film.performance.film#M'), 48417)
(('writer', '?x#ns:film.writer.film#M'), 47417)
(('editor', '?x#ns:film.editor.film#M'), 46570)
(('cinematographer', '?x#ns:film.cinematographer.film#M'), 46418)
(('produced', '?x#ns:film.film.produced_by|ns:... | ContextualSP/poset_decoding/data/phrase_table/0 | {
"file_path": "ContextualSP/poset_decoding/data/phrase_table",
"repo_id": "ContextualSP",
"token_count": 8291
} | 244 |
# .coveragerc to control coverage.py
[report]
# regrexes for lines to exclude from consideration
exclude_lines =
if __name__ == .__main__.:
ValueError
TypeError
NotImplementedError
omit =
matchzoo/__init__.py
matchzoo/version.py
matchzoo/*/__init__.py
| ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/.coveragerc/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/.coveragerc",
"repo_id": "ContextualSP",
"token_count": 97
} | 245 |
.. MatchZoo documentation master file, created by
sphinx-quickstart on Mon May 28 16:40:41 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to MatchZoo's documentation!
====================================
.. image:: https://travis... | ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/docs/source/index.rst/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/docs/source/index.rst",
"repo_id": "ContextualSP",
"token_count": 377
} | 246 |
from .lambda_callback import LambdaCallback
from .histogram import Histogram
from .ngram import Ngram
from .padding import BasicPadding
from .padding import DRMMPadding
from .padding import BertPadding
| ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/dataloader/callbacks/__init__.py/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/dataloader/callbacks/__init__.py",
"repo_id": "ContextualSP",
"token_count": 50
} | 247 |
"""Matchzoo toolkit for token embedding."""
import csv
import typing
import numpy as np
import pandas as pd
import matchzoo as mz
class Embedding(object):
"""
Embedding class.
Examples::
>>> import matchzoo as mz
>>> train_raw = mz.datasets.toy.load_data()
>>> pp = mz.preproces... | ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/embedding/embedding.py/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/embedding/embedding.py",
"repo_id": "ContextualSP",
"token_count": 1574
} | 248 |
"""CrossEntropy metric for Classification."""
import numpy as np
from matchzoo.engine.base_metric import ClassificationMetric
from matchzoo.utils import one_hot
class CrossEntropy(ClassificationMetric):
"""Cross entropy metric."""
ALIAS = ['cross_entropy', 'ce']
def __init__(self):
""":class:`C... | ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/metrics/cross_entropy.py/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/metrics/cross_entropy.py",
"repo_id": "ContextualSP",
"token_count": 631
} | 249 |
"""An implementation of DIIN Model."""
import typing
import torch
import torch.nn as nn
from matchzoo import preprocessors
from matchzoo.engine.param_table import ParamTable
from matchzoo.engine.base_callback import BaseCallback
from matchzoo.engine.base_preprocessor import BasePreprocessor
from matchzoo.engine.param... | ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/models/diin.py/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/models/diin.py",
"repo_id": "ContextualSP",
"token_count": 4758
} | 250 |
"""Bert module."""
import typing
import torch
import torch.nn as nn
from pytorch_transformers import BertModel
class BertModule(nn.Module):
"""
Bert module.
BERT (from Google) released with the paper BERT: Pre-training of Deep
Bidirectional Transformers for Language Understanding by Jacob Devlin,
... | ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/modules/bert_module.py/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/modules/bert_module.py",
"repo_id": "ContextualSP",
"token_count": 444
} | 251 |
"""Wrapper function organizes a number of transform functions."""
import typing
import functools
from .units.unit import Unit
def chain_transform(units: typing.List[Unit]) -> typing.Callable:
"""
Compose unit transformations into a single function.
:param units: List of :class:`matchzoo.StatelessUnit`.
... | ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/preprocessors/chain_transform.py/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/preprocessors/chain_transform.py",
"repo_id": "ContextualSP",
"token_count": 232
} | 252 |
import abc
import typing
class Unit(metaclass=abc.ABCMeta):
"""Process unit do not persive state (i.e. do not need fit)."""
@abc.abstractmethod
def transform(self, input_: typing.Any):
"""Abstract base method, need to be implemented in subclass."""
| ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/preprocessors/units/unit.py/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/preprocessors/units/unit.py",
"repo_id": "ContextualSP",
"token_count": 91
} | 253 |
"""Define Keras tensor type."""
import typing
TensorType = typing.Any
| ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/utils/tensor_type.py/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/matchzoo/utils/tensor_type.py",
"repo_id": "ContextualSP",
"token_count": 23
} | 254 |
import torch
import pytest
from matchzoo.modules import Matching
def test_matching():
x = torch.randn(2, 3, 2)
y = torch.randn(2, 4, 2)
z = torch.randn(2, 3, 3)
for matching_type in ['dot', 'mul', 'plus', 'minus', 'concat']:
Matching(matching_type=matching_type)(x, y)
with pytest.raises(V... | ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/tests/modules/test_modules.py/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/tests/modules/test_modules.py",
"repo_id": "ContextualSP",
"token_count": 191
} | 255 |
<jupyter_start><jupyter_code>%run init.ipynb
preprocessor = mz.models.CDSSM.get_default_preprocessor(
ngram_size = 3
)
train_pack_processed = preprocessor.fit_transform(train_pack_raw)
valid_pack_processed = preprocessor.transform(dev_pack_raw)
test_pack_processed = preprocessor.transform(test_pack_raw)
preprocesso... | ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/tutorials/ranking/cdssm.ipynb/0 | {
"file_path": "ContextualSP/poset_decoding/traversal_path_prediction/MatchZoo-py/tutorials/ranking/cdssm.ipynb",
"repo_id": "ContextualSP",
"token_count": 768
} | 256 |
set seed=1
set config_file=train_configs_bert/concat.none.jsonnet
set model_file=checkpoints_sparc/sparc_bert_concat_none_model
set tables_file=dataset_sparc/tables.json
set database_path=dataset_sparc/database
set dataset_path=dataset_sparc
set train_data_path=dataset_sparc/train.json
set validation_data_path=dataset_... | ContextualSP/semantic_parsing_in_context/bash_files/windows/train_sparc_bert.bat/0 | {
"file_path": "ContextualSP/semantic_parsing_in_context/bash_files/windows/train_sparc_bert.bat",
"repo_id": "ContextualSP",
"token_count": 339
} | 257 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from allennlp.common.util import JsonDict
from allennlp.data import DatasetReader, Instance
from allennlp.models import Model
from allennlp.predictors.predictor import Predictor
from overrides import overrides
@Predictor.register("sparc")
class... | ContextualSP/semantic_parsing_in_context/predictor/sparc_predictor.py/0 | {
"file_path": "ContextualSP/semantic_parsing_in_context/predictor/sparc_predictor.py",
"repo_id": "ContextualSP",
"token_count": 650
} | 258 |
## Introduction
This paper introduces [UniSAr](https://arxiv.org/pdf/2203.07781.pdf), which extends existing autoregressive language models to incorporate three non-invasive extensions to make them structure-aware:
(1) adding structure mark to encode database schema, conversation context, and their relationships;
(2... | ContextualSP/unified_parser_text_to_sql/README.md/0 | {
"file_path": "ContextualSP/unified_parser_text_to_sql/README.md",
"repo_id": "ContextualSP",
"token_count": 718
} | 259 |
import os
import traceback
import re
import sys
import json
import sqlite3
import random
from os import listdir, makedirs
from collections import OrderedDict
from nltk import word_tokenize, tokenize
from os.path import isfile, isdir, join, split, exists, splitext
from ..process_sql import get_sql
from .schema import S... | ContextualSP/unified_parser_text_to_sql/third_party/spider/preprocess/parse_sql_one.py/0 | {
"file_path": "ContextualSP/unified_parser_text_to_sql/third_party/spider/preprocess/parse_sql_one.py",
"repo_id": "ContextualSP",
"token_count": 251
} | 260 |
# Searching the Search Space of Vision Transformer
**This is an official implementation of S3.**
In this work, instead of searching the architecture in a predefined search space, with the help of AutoFormer, we proposed to search the search space to automatically find a great search space first. After that we search ... | Cream/AutoFormerV2/README.md/0 | {
"file_path": "Cream/AutoFormerV2/README.md",
"repo_id": "Cream",
"token_count": 1230
} | 261 |
import logging
import torch.nn as nn
from ..runner import load_checkpoint
from .weight_init import constant_init, kaiming_init, normal_init
def conv3x3(in_planes, out_planes, dilation=1):
"3x3 convolution with padding"
return nn.Conv2d(
in_planes,
out_planes,
kernel_size=3,
p... | Cream/CDARTS/CDARTS_detection/mmcv/cnn/vgg.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmcv/cnn/vgg.py",
"repo_id": "Cream",
"token_count": 3264
} | 262 |
from __future__ import division
import cv2
def _scale_size(size, scale):
"""Rescale a size by a ratio.
Args:
size (tuple): w, h.
scale (float): Scaling factor.
Returns:
tuple[int]: scaled size.
"""
w, h = size
return int(w * float(scale) + 0.5), int(h * float(scale) ... | Cream/CDARTS/CDARTS_detection/mmcv/image/transforms/resize.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmcv/image/transforms/resize.py",
"repo_id": "Cream",
"token_count": 1486
} | 263 |
import time
from .hook import Hook
class IterTimerHook(Hook):
def before_epoch(self, runner):
self.t = time.time()
def before_iter(self, runner):
runner.log_buffer.update({'data_time': time.time() - self.t})
def after_iter(self, runner):
runner.log_buffer.update({'time': time.t... | Cream/CDARTS/CDARTS_detection/mmcv/runner/hooks/iter_timer.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmcv/runner/hooks/iter_timer.py",
"repo_id": "Cream",
"token_count": 151
} | 264 |
import os.path as osp
import sys
from argparse import ArgumentParser
from importlib import import_module
from addict import Dict
from .misc import collections_abc
from .path import check_file_exist
class ConfigDict(Dict):
def __missing__(self, name):
raise KeyError(name)
def __getattr__(self, name... | Cream/CDARTS/CDARTS_detection/mmcv/utils/config.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmcv/utils/config.py",
"repo_id": "Cream",
"token_count": 2414
} | 265 |
from enum import Enum
import numpy as np
from mmcv.utils import is_str
class Color(Enum):
"""An enum that defines common colors.
Contains red, green, blue, cyan, yellow, magenta, white and black.
"""
red = (0, 0, 255)
green = (0, 255, 0)
blue = (255, 0, 0)
cyan = (255, 255, 0)
yello... | Cream/CDARTS/CDARTS_detection/mmcv/visualization/color.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmcv/visualization/color.py",
"repo_id": "Cream",
"token_count": 556
} | 266 |
import torch
class AnchorGenerator(object):
def __init__(self, base_size, scales, ratios, scale_major=True, ctr=None):
self.base_size = base_size
self.scales = torch.Tensor(scales)
self.ratios = torch.Tensor(ratios)
self.scale_major = scale_major
self.ctr = ctr
sel... | Cream/CDARTS/CDARTS_detection/mmdet/core/anchor/anchor_generator.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/core/anchor/anchor_generator.py",
"repo_id": "Cream",
"token_count": 1566
} | 267 |
import numpy as np
import torch
from .random_sampler import RandomSampler
class IoUBalancedNegSampler(RandomSampler):
"""IoU Balanced Sampling
arXiv: https://arxiv.org/pdf/1904.02701.pdf (CVPR 2019)
Sampling proposals according to their IoU. `floor_fraction` of needed RoIs
are sampled from proposal... | Cream/CDARTS/CDARTS_detection/mmdet/core/bbox/samplers/iou_balanced_neg_sampler.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/core/bbox/samplers/iou_balanced_neg_sampler.py",
"repo_id": "Cream",
"token_count": 3156
} | 268 |
from collections import abc
import numpy as np
import torch
def cast_tensor_type(inputs, src_type, dst_type):
if isinstance(inputs, torch.Tensor):
return inputs.to(dst_type)
elif isinstance(inputs, str):
return inputs
elif isinstance(inputs, np.ndarray):
return inputs
elif isi... | Cream/CDARTS/CDARTS_detection/mmdet/core/fp16/utils.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/core/fp16/utils.py",
"repo_id": "Cream",
"token_count": 298
} | 269 |
from .build_loader import build_dataloader, build_dataloader_arch
from .sampler import DistributedGroupSampler, GroupSampler
__all__ = ['GroupSampler', 'DistributedGroupSampler', 'build_dataloader', 'build_dataloader_arch']
| Cream/CDARTS/CDARTS_detection/mmdet/datasets/loader/__init__.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/datasets/loader/__init__.py",
"repo_id": "Cream",
"token_count": 73
} | 270 |
from .anchor_head import AnchorHead
from .guided_anchor_head import GuidedAnchorHead, FeatureAdaption
from .fcos_head import FCOSHead
from .rpn_head import RPNHead
from .ga_rpn_head import GARPNHead
from .retina_head import RetinaHead
from .ga_retina_head import GARetinaHead
from .ssd_head import SSDHead
__all__ = [
... | Cream/CDARTS/CDARTS_detection/mmdet/models/anchor_heads/__init__.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/models/anchor_heads/__init__.py",
"repo_id": "Cream",
"token_count": 174
} | 271 |
predefine_archs = {
'fbnet_b': {
'genotypes' : [
'conv3', 'ir_k3_e1',
'ir_k3_e6', 'ir_k5_e6', 'ir_k3_e1', 'ir_k3_e1',
'ir_k5_e6', 'ir_k5_e3', 'ir_k3_e6', 'ir_k5_e6',
'ir_k5_e6', 'ir_k5_e1', 'skip' , 'ir_k5_e3',
'ir_k5_e6', 'ir_k3_e1', 'ir_k5_e1', 'ir_k5_e3',
'ir_k5_e6', '... | Cream/CDARTS/CDARTS_detection/mmdet/models/backbones/fbnet_arch.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/models/backbones/fbnet_arch.py",
"repo_id": "Cream",
"token_count": 1049
} | 272 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from mmdet.core import (auto_fp16, bbox_target, delta2bbox, force_fp32,
multiclass_nms)
from ..builder import build_loss
from ..losses import accuracy
from ..registry import HEADS
@HEAD... | Cream/CDARTS/CDARTS_detection/mmdet/models/bbox_heads/bbox_head.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/models/bbox_heads/bbox_head.py",
"repo_id": "Cream",
"token_count": 5149
} | 273 |
import mmcv
from mmdet.core import tensor2imgs, bbox_mapping
from .base import BaseDetector
from .test_mixins import RPNTestMixin
from .. import builder
from ..registry import DETECTORS
@DETECTORS.register_module
class RPN(BaseDetector, RPNTestMixin):
def __init__(self,
backbone,
... | Cream/CDARTS/CDARTS_detection/mmdet/models/detectors/rpn.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/models/detectors/rpn.py",
"repo_id": "Cream",
"token_count": 1702
} | 274 |
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import kaiming_init
from mmdet.core import auto_fp16, force_fp32
from ..registry import HEADS
from ..utils import ConvModule
@HEADS.register_module
class FusedSemanticHead(nn.Module):
"""Multi-level fused semantic segmentation head.
in_1 ->... | Cream/CDARTS/CDARTS_detection/mmdet/models/mask_heads/fused_semantic_head.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/models/mask_heads/fused_semantic_head.py",
"repo_id": "Cream",
"token_count": 1957
} | 275 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import numpy as np
from mmcv.cnn import kaiming_init
class GeneralizedAttention(nn.Module):
"""GeneralizedAttention module.
See 'An Empirical Study of Spatial Attention Mechanisms in Deep Networks'
(https://arxiv.org/abs/1711... | Cream/CDARTS/CDARTS_detection/mmdet/models/plugins/generalized_attention.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/models/plugins/generalized_attention.py",
"repo_id": "Cream",
"token_count": 8961
} | 276 |
import os.path as osp
import sys
import numpy as np
import torch
from torch.autograd import gradcheck
sys.path.append(osp.abspath(osp.join(__file__, '../../')))
from roi_align import RoIAlign # noqa: E402, isort:skip
feat_size = 15
spatial_scale = 1.0 / 8
img_size = feat_size / spatial_scale
num_imgs = 2
num_rois =... | Cream/CDARTS/CDARTS_detection/mmdet/ops/roi_align/gradcheck.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/ops/roi_align/gradcheck.py",
"repo_id": "Cream",
"token_count": 371
} | 277 |
from .modules.sigmoid_focal_loss import SigmoidFocalLoss, sigmoid_focal_loss
__all__ = ['SigmoidFocalLoss', 'sigmoid_focal_loss']
| Cream/CDARTS/CDARTS_detection/mmdet/ops/sigmoid_focal_loss/__init__.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/ops/sigmoid_focal_loss/__init__.py",
"repo_id": "Cream",
"token_count": 55
} | 278 |
# GENERATED VERSION FILE
# TIME: Fri Oct 15 17:01:16 2021
__version__ = '0.6.0+0889383'
short_version = '0.6.0'
| Cream/CDARTS/CDARTS_detection/mmdet/version.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_detection/mmdet/version.py",
"repo_id": "Cream",
"token_count": 50
} | 279 |
data_path: "../DATASET/cityscapes/"
det2_cfg: "configs/Cityscapes-PanopticSegmentation/panoptic_deeplab_R_52_os16_mg124_poly_90k_bs32_crop_512_1024.yaml"
seed: 12345
random_sample: False
opt: "sgd"
opt_eps: 0.001
sched: "new" #"raw for original"
epochs: 4000
drop_path_prob: 0.2
image_height: 512
image_width: 1024
eval_... | Cream/CDARTS/CDARTS_segmentation/configs/cityscapes/cydas.yaml/0 | {
"file_path": "Cream/CDARTS/CDARTS_segmentation/configs/cityscapes/cydas.yaml",
"repo_id": "Cream",
"token_count": 240
} | 280 |
# ------------------------------------------------------------------------------
# Reference: https://github.com/tensorflow/models/blob/master/research/deeplab/datasets/data_generator.py
# ------------------------------------------------------------------------------
import collections
# Named tuple to describe the d... | Cream/CDARTS/CDARTS_segmentation/dataloaders/segdatasets/utils.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_segmentation/dataloaders/segdatasets/utils.py",
"repo_id": "Cream",
"token_count": 307
} | 281 |
from .resnet import *
from .mobilenet import *
from .mnasnet import *
from .hrnet import *
from .xception import *
| Cream/CDARTS/CDARTS_segmentation/segmentation/model/backbone/__init__.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_segmentation/segmentation/model/backbone/__init__.py",
"repo_id": "Cream",
"token_count": 38
} | 282 |
# ------------------------------------------------------------------------------
# Base model for segmentation.
# Written by Bowen Cheng (bcheng9@illinois.edu)
# ------------------------------------------------------------------------------
from collections import OrderedDict
from torch import nn
from torch.nn import... | Cream/CDARTS/CDARTS_segmentation/segmentation/model/meta_arch/base.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_segmentation/segmentation/model/meta_arch/base.py",
"repo_id": "Cream",
"token_count": 893
} | 283 |
# MIT License
#
# Copyright (c) 2018 Tom Runia
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | Cream/CDARTS/CDARTS_segmentation/segmentation/utils/flow_vis.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_segmentation/segmentation/utils/flow_vis.py",
"repo_id": "Cream",
"token_count": 1736
} | 284 |
import numpy as np
import json
import torch
import torch.nn as nn
def __init_weight(feature, conv_init, norm_layer, bn_eps, bn_momentum,
**kwargs):
for name, m in feature.named_modules():
if isinstance(m, (nn.Conv2d, nn.Conv3d)):
conv_init(m.weight, **kwargs)
elif isi... | Cream/CDARTS/CDARTS_segmentation/tools/utils/init_func.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_segmentation/tools/utils/init_func.py",
"repo_id": "Cream",
"token_count": 1209
} | 285 |
MODEL:
META_ARCHITECTURE: "PanopticDeepLab"
BACKBONE:
FREEZE_AT: 0
RESNETS:
OUT_FEATURES: ["res2", "res3", "res5"]
RES5_DILATION: 2
SEM_SEG_HEAD:
NAME: "PanopticDeepLabSemSegHead"
IN_FEATURES: ["res2", "res3", "res5"]
PROJECT_FEATURES: ["res2", "res3"]
PROJECT_CHANNELS: [32, 64]
... | Cream/CDARTS/CDARTS_segmentation/train/configs/Cityscapes-PanopticSegmentation/Base-PanopticDeepLab-OS16.yaml/0 | {
"file_path": "Cream/CDARTS/CDARTS_segmentation/train/configs/Cityscapes-PanopticSegmentation/Base-PanopticDeepLab-OS16.yaml",
"repo_id": "Cream",
"token_count": 841
} | 286 |
#!/usr/bin/env python3
# encoding: utf-8
import os
import time
import cv2
cv2.setNumThreads(0)
import torchvision
from PIL import Image
import argparse
import numpy as np
import torch
import torch.multiprocessing as mp
from utils.pyt_utils import ensure_dir, link_file, load_model, parse_devices
from utils.visualize i... | Cream/CDARTS/CDARTS_segmentation/train/test.py/0 | {
"file_path": "Cream/CDARTS/CDARTS_segmentation/train/test.py",
"repo_id": "Cream",
"token_count": 1040
} | 287 |
""" CNN cell for network augmentation """
import torch.nn as nn
from copy import deepcopy
from models.ops import OPS
# Cell for NAS-Bench-201
class InferCell(nn.Module):
def __init__(self, genotype, C_in, C_out, stride):
super(InferCell, self).__init__()
self.layers = nn.ModuleList()
self.node_IN = [... | Cream/CDARTS/benchmark201/models/augment_cells.py/0 | {
"file_path": "Cream/CDARTS/benchmark201/models/augment_cells.py",
"repo_id": "Cream",
"token_count": 798
} | 288 |
""" Network architecture visualizer using graphviz """
import sys
from graphviz import Digraph
import utils.genotypes as gt
def plot(genotype, file_path, caption=None):
""" make DAG plot and save to file_path as .png """
edge_attr = {
'fontsize': '20',
'fontname': 'times'
}
node_attr =... | Cream/CDARTS/benchmark201/utils/visualize.py/0 | {
"file_path": "Cream/CDARTS/benchmark201/utils/visualize.py",
"repo_id": "Cream",
"token_count": 938
} | 289 |
import torch.nn as nn
from lib.models.augment_cells import AugmentCell
class ModelTest(nn.Module):
def __init__(self, genotypes_dict, model_type, res_stem=False, init_channel=96, stem_multiplier=3, n_nodes=4, num_classes=1000):
"""
args:
"""
super(ModelTest, self).__init__()
... | Cream/CDARTS/lib/models/model_test.py/0 | {
"file_path": "Cream/CDARTS/lib/models/model_test.py",
"repo_id": "Cream",
"token_count": 3164
} | 290 |
# 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 torchvision
import torch.nn.functional as F
from lib.utils.util import *
# supernet train function
def train_epoch(epoch, mod... | Cream/Cream/lib/core/train.py/0 | {
"file_path": "Cream/Cream/lib/core/train.py",
"repo_id": "Cream",
"token_count": 4398
} | 291 |
# 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
# This file is to add current path into python library.
from __future__ import absolute_import
from __future__ import division
from __future__ im... | Cream/Cream/tools/_init_paths.py/0 | {
"file_path": "Cream/Cream/tools/_init_paths.py",
"repo_id": "Cream",
"token_count": 222
} | 292 |
"""
3Augment implementation from (https://github.com/facebookresearch/deit/blob/main/augment.py)
Data-augmentation (DA) based on dino DA (https://github.com/facebookresearch/dino)
and timm DA(https://github.com/rwightman/pytorch-image-models)
Can be called by adding "--ThreeAugment" to the command line
"""
import torch... | Cream/EfficientViT/classification/data/threeaugment.py/0 | {
"file_path": "Cream/EfficientViT/classification/data/threeaugment.py",
"repo_id": "Cream",
"token_count": 1647
} | 293 |
# dataset settings
dataset_type = 'DeepFashionDataset'
data_root = 'data/DeepFashion/In-shop/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
d... | Cream/EfficientViT/downstream/configs/_base_/datasets/deepfashion.py/0 | {
"file_path": "Cream/EfficientViT/downstream/configs/_base_/datasets/deepfashion.py",
"repo_id": "Cream",
"token_count": 892
} | 294 |
# --------------------------------------------------------
# EfficientViT FPN Architecture for Downstream Tasks
# Copyright (c) 2022 Microsoft
# Adapted from mmdetection FPN and LightViT
# mmdetection: (https://github.com/open-mmlab/mmdetection)
# LightViT: (https://github.com/hunto/LightViT)
# Written by: Xinyu Li... | Cream/EfficientViT/downstream/efficientvit_fpn.py/0 | {
"file_path": "Cream/EfficientViT/downstream/efficientvit_fpn.py",
"repo_id": "Cream",
"token_count": 6310
} | 295 |
"""
Train and eval functions used in main.py
"""
import math
import sys
from typing import Iterable, Optional
import torch
from timm.data import Mixup
from timm.utils import accuracy, ModelEma
from losses import DistillationLoss
import utils
def train_one_epoch(model: torch.nn.Module, criterion: DistillationLoss,
... | Cream/MiniViT/Mini-DeiT/engine.py/0 | {
"file_path": "Cream/MiniViT/Mini-DeiT/engine.py",
"repo_id": "Cream",
"token_count": 1452
} | 296 |
# Mini-Swin
This repo is for MiniViT for swin transformers.
## Model Zoo
Model | Params. | Input | Top-1 Acc. % | Top-5 Acc. % | Download link
--- |:---:|:---:|:---:|:---:|:---:
Mini-Swin-T | 12M | 224x224 | 81.3 | 95.7 | [model](https://github.com/DominickZhang/MiniViT-model-zoo/releases/download/v1.0.0/mini-swin-ti... | Cream/MiniViT/Mini-Swin/README.md/0 | {
"file_path": "Cream/MiniViT/Mini-Swin/README.md",
"repo_id": "Cream",
"token_count": 2359
} | 297 |
import os
import zipfile
import io
import numpy as np
from PIL import Image
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
def is_zip_path(img_or_path):
"""judge if this is a zip path"""
return '.zip@' in img_or_path
class ZipReader(object):
"""A class to read zipped files"""
zip_... | Cream/MiniViT/Mini-Swin/data/zipreader.py/0 | {
"file_path": "Cream/MiniViT/Mini-Swin/data/zipreader.py",
"repo_id": "Cream",
"token_count": 1494
} | 298 |
# Neural Architecture Design and Search [](https://twitter.com/intent/tweet?text=A%20new%20collection%20of%20tiny%20and%20efficient%20models%20thru%20architecture%20design%20and%20search,%20SOTA%20performance!!&url=https://github.com/microsof... | Cream/README.md/0 | {
"file_path": "Cream/README.md",
"repo_id": "Cream",
"token_count": 4155
} | 299 |
export NNODES=1
export GPUS_PER_NODE=8
DISTRIBUTED_ARGS="--nproc_per_node $GPUS_PER_NODE --nnodes $NNODES"
torchrun $DISTRIBUTED_ARGS src/training/main.py \
--save-frequency 1 \
--report-to wandb \
--train-data synthetic \
--dataset-type synthetic \
--imagenet-val ./ImageNet \
--warmup 3000 \
--batch-size 1024 ... | Cream/TinyCLIP/script/auto_weight_inherit_100to75.sh/0 | {
"file_path": "Cream/TinyCLIP/script/auto_weight_inherit_100to75.sh",
"repo_id": "Cream",
"token_count": 362
} | 300 |
{
"embed_dim": 1024,
"vision_cfg": {
"image_size": 224,
"layers": [
3,
4,
6,
3
],
"width": 64,
"patch_size": null
},
"text_cfg": {
"context_length": 77,
"vocab_size": 49408,
"width": 512,
... | Cream/TinyCLIP/src/open_clip/model_configs/RN50.json/0 | {
"file_path": "Cream/TinyCLIP/src/open_clip/model_configs/RN50.json",
"repo_id": "Cream",
"token_count": 234
} | 301 |
__version__ = '2.0.2'
| Cream/TinyCLIP/src/open_clip/version.py/0 | {
"file_path": "Cream/TinyCLIP/src/open_clip/version.py",
"repo_id": "Cream",
"token_count": 12
} | 302 |
# --------------------------------------------------------
# reference: https://github.com/crj1998/pruning/tree/master
# --------------------------------------------------------
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.cm as cm
from matplotlib.colors import LinearSegmented... | Cream/TinyCLIP/src/training/viz.py/0 | {
"file_path": "Cream/TinyCLIP/src/training/viz.py",
"repo_id": "Cream",
"token_count": 948
} | 303 |
import math
import torch
from torch.utils.data import Sampler
import torch.distributed as dist
class OrderedDistributedSampler(Sampler):
"""Sampler that restricts data loading to a subset of the dataset.
It is especially useful in conjunction with
:class:`torch.nn.parallel.DistributedDataParallel`. In suc... | Cream/TinyViT/data/augmentation/distributed_sampler.py/0 | {
"file_path": "Cream/TinyViT/data/augmentation/distributed_sampler.py",
"repo_id": "Cream",
"token_count": 2098
} | 304 |
import torch
import torchvision.transforms.functional as F
try:
from torchvision.transforms.functional import InterpolationMode
has_interpolation_mode = True
except ImportError:
has_interpolation_mode = False
from PIL import Image
import warnings
import math
from .aug_random import random
import numpy as np... | Cream/TinyViT/data/augmentation/transforms.py/0 | {
"file_path": "Cream/TinyViT/data/augmentation/transforms.py",
"repo_id": "Cream",
"token_count": 2875
} | 305 |
# --------------------------------------------------------
# TinyViT Model Builder
# Copyright (c) 2022 Microsoft
# --------------------------------------------------------
from .tiny_vit import TinyViT
def build_model(config):
model_type = config.MODEL.TYPE
if model_type == 'tiny_vit':
M = config.MO... | Cream/TinyViT/models/build.py/0 | {
"file_path": "Cream/TinyViT/models/build.py",
"repo_id": "Cream",
"token_count": 863
} | 306 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
COCO evaluator that works in distributed mode.
Mostly copy-paste from https://github.com/pytorch/vision/blob/edfd5a7/references/detection/coco_eval.py
The difference is that there is less copy-pasting from pycocotools
in the end of the file, as... | Cream/iRPE/DETR-with-iRPE/datasets/coco_eval.py/0 | {
"file_path": "Cream/iRPE/DETR-with-iRPE/datasets/coco_eval.py",
"repo_id": "Cream",
"token_count": 4188
} | 307 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
DETR Transformer class.
Copy-paste from torch.nn.Transformer with modifications:
* positional encodings are passed in MHattention
* extra LN at the end of encoder is removed
* decoder returns a stack of activations from all decoding... | Cream/iRPE/DETR-with-iRPE/models/transformer.py/0 | {
"file_path": "Cream/iRPE/DETR-with-iRPE/models/transformer.py",
"repo_id": "Cream",
"token_count": 7291
} | 308 |
[flake8]
max-line-length = 120
ignore = F401,E402,F403,W503,W504
| Cream/iRPE/DeiT-with-iRPE/tox.ini/0 | {
"file_path": "Cream/iRPE/DeiT-with-iRPE/tox.ini",
"repo_id": "Cream",
"token_count": 30
} | 309 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import os
from timm.data import create_loader
import torch
import torch.utils.data
import torchvision.datasets as datasets
from .transformas import build_transforms
from .samplers import RASamp... | CvT/lib/dataset/build.py/0 | {
"file_path": "CvT/lib/dataset/build.py",
"repo_id": "CvT",
"token_count": 1703
} | 310 |
"""
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/utils.py/0 | {
"file_path": "anomalydetector/srcnn/utils.py",
"repo_id": "anomalydetector",
"token_count": 5208
} | 311 |
This is the list of Archai authors for copyright purposes.
This does not necessarily list everyone who has contributed code, since in some cases, their employer may be the copyright holder. To see the full list of contributors, see the revision history in source control.
- [Shital Shah](http://www.shitalshah.com)
- ... | archai/AUTHORS.md/0 | {
"file_path": "archai/AUTHORS.md",
"repo_id": "archai",
"token_count": 220
} | 312 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import atexit
import os
import subprocess
from typing import Optional, Tuple, Union
import yaml
from send2trash import send2trash
from torch.utils.tensorboard.writer import SummaryWriter
from archai.common import utils
from archai.common.apex_u... | archai/archai/common/common.py/0 | {
"file_path": "archai/archai/common/common.py",
"repo_id": "archai",
"token_count": 3788
} | 313 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import csv
import logging
import multiprocessing
import os
import pathlib
import platform
import random
import shutil
import subprocess
import sys
from collections import OrderedDict
from datetime import datetime
from itertools import zip_longest... | archai/archai/common/utils.py/0 | {
"file_path": "archai/archai/common/utils.py",
"repo_id": "archai",
"token_count": 6440
} | 314 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Callable, Optional
from overrides import overrides
from torch.utils.data import Dataset
from torchvision.datasets import SVHN
from torchvision.transforms import ToTensor
from archai.api.dataset_provider import DatasetProvider... | archai/archai/datasets/cv/svhn_dataset_provider.py/0 | {
"file_path": "archai/archai/datasets/cv/svhn_dataset_provider.py",
"repo_id": "archai",
"token_count": 879
} | 315 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from abc import abstractmethod
from typing import List, Optional
from overrides import EnforceOverrides
from archai.api.dataset_provider import DatasetProvider
from archai.discrete_search.api.archai_model import ArchaiModel
class ModelEvaluat... | archai/archai/discrete_search/api/model_evaluator.py/0 | {
"file_path": "archai/archai/discrete_search/api/model_evaluator.py",
"repo_id": "archai",
"token_count": 2062
} | 316 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Dict, List, Optional, Union
import torch
from overrides import overrides
from archai.discrete_search.api.archai_model import ArchaiModel
from archai.discrete_search.api.model_evaluator import ModelEvaluator
from archai.discre... | archai/archai/discrete_search/evaluators/pt_profiler.py/0 | {
"file_path": "archai/archai/discrete_search/evaluators/pt_profiler.py",
"repo_id": "archai",
"token_count": 3869
} | 317 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from copy import deepcopy
from typing import Any, Dict, List, Optional, Union
from archai.discrete_search.search_spaces.config.discrete_choice import DiscreteChoice
def repeat_config(
config_dict: Dict[str, Any], repeat_times: Union[int, L... | archai/archai/discrete_search/search_spaces/config/helpers.py/0 | {
"file_path": "archai/archai/discrete_search/search_spaces/config/helpers.py",
"repo_id": "archai",
"token_count": 499
} | 318 |
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/model.py/0 | {
"file_path": "archai/archai/discrete_search/search_spaces/nlp/tfpp/backbones/gpt2/model.py",
"repo_id": "archai",
"token_count": 10766
} | 319 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from transformers.models.transfo_xl.configuration_transfo_xl import TransfoXLConfig
class MemTransformerConfig(TransfoXLConfig):
model_type = "mem-transformer"
def __init__(self, *args, **kwargs) -> None:
if "primer_conv" not i... | archai/archai/discrete_search/search_spaces/nlp/transformer_flex/models/configuration_mem_transformer.py/0 | {
"file_path": "archai/archai/discrete_search/search_spaces/nlp/transformer_flex/models/configuration_mem_transformer.py",
"repo_id": "archai",
"token_count": 282
} | 320 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Any, Mapping, Optional, Tuple
import torch
from overrides import overrides
from transformers.configuration_utils import PretrainedConfig
from archai.onnx.config_utils.onnx_config_base import OnnxConfig, OnnxConfigWithPast
c... | archai/archai/onnx/config_utils/gpt2_onnx_config.py/0 | {
"file_path": "archai/archai/onnx/config_utils/gpt2_onnx_config.py",
"repo_id": "archai",
"token_count": 1166
} | 321 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import List, Optional
import onnx
import torch
from onnx import onnx_pb as onnx_proto
from onnx.onnx_ml_pb2 import NodeProto
from onnxruntime.quantization.onnx_quantizer import ONNXQuantizer
from onnxruntime.quantization.operators.ba... | archai/archai/quantization/ptq.py/0 | {
"file_path": "archai/archai/quantization/ptq.py",
"repo_id": "archai",
"token_count": 2297
} | 322 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from overrides import overrides
from archai.supergraph.algos.petridish.petridish_model_desc_builder import (
PetridishModelBuilder,
)
from archai.supergraph.nas.arch_trainer import ArchTrainer, TArchTrainer
from archai.supergraph.nas.exp_run... | archai/archai/supergraph/algos/nasbench101/nasbench101_exp_runner.py/0 | {
"file_path": "archai/archai/supergraph/algos/nasbench101/nasbench101_exp_runner.py",
"repo_id": "archai",
"token_count": 197
} | 323 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import copy
from typing import List, Tuple
from overrides import overrides
from archai.common.config import Config
from archai.supergraph.algos.xnas.xnas_op import XnasOp
from archai.supergraph.nas.model_desc import (
CellType,
ConvMacr... | archai/archai/supergraph/algos/xnas/xnas_model_desc_builder.py/0 | {
"file_path": "archai/archai/supergraph/algos/xnas/xnas_model_desc_builder.py",
"repo_id": "archai",
"token_count": 978
} | 324 |
# 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/food101_provider.py/0 | {
"file_path": "archai/archai/supergraph/datasets/providers/food101_provider.py",
"repo_id": "archai",
"token_count": 1097
} | 325 |
import os
import torch
import torch.nn as nn
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d']
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, ... | archai/archai/supergraph/models/resnet.py/0 | {
"file_path": "archai/archai/supergraph/models/resnet.py",
"repo_id": "archai",
"token_count": 4870
} | 326 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Dict, Optional
from overrides import EnforceOverrides
from torch import nn
from archai.common import ml_utils, utils
from archai.common.config import Config
from archai.common.ordered_dict_logger import get_global_logger
from... | archai/archai/supergraph/nas/evaluater.py/0 | {
"file_path": "archai/archai/supergraph/nas/evaluater.py",
"repo_id": "archai",
"token_count": 2185
} | 327 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Any, Dict, List, Optional
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.axes import Axes
def heatmap(
data: np.array,
ax: Optional[Axes] = None,
xtick_labels: Optional[List[... | archai/archai/supergraph/utils/heatmap.py/0 | {
"file_path": "archai/archai/supergraph/utils/heatmap.py",
"repo_id": "archai",
"token_count": 948
} | 328 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import math
from typing import Dict, Optional
from transformers.trainer_callback import TrainerCallback, TrainerControl, TrainerState
from transformers.training_args import TrainingArguments
class BPCTrainerCallback(TrainerCallback):
"""A ... | archai/archai/trainers/nlp/hf_callbacks.py/0 | {
"file_path": "archai/archai/trainers/nlp/hf_callbacks.py",
"repo_id": "archai",
"token_count": 2021
} | 329 |
__include__: 'darts.yaml' # defaults are loaded from this file
common:
#yaml_log: False
apex:
ray:
enabled: True # initialize ray. Note: ray cannot be used if apex distributed is enabled
local_mode: False # if True then ray runs in serial mode
nas:
eval:
final_desc_foldername: '$expdir/model... | archai/confs/algos/petridish.yaml/0 | {
"file_path": "archai/confs/algos/petridish.yaml",
"repo_id": "archai",
"token_count": 967
} | 330 |
# Using Docker to Run Archai
This folder contains tools for creating development and production environments that are secure and isolated from the host system, including Docker and gVisor.
## Docker
The Dockerfile can be used to build a development environment for running experiments. The `build_image.sh` and `run_c... | archai/docker/README.md/0 | {
"file_path": "archai/docker/README.md",
"repo_id": "archai",
"token_count": 475
} | 331 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
from pathlib import Path
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Generates new tokens with a pre-trained... | archai/docs/advanced_guide/cloud/azure/notebooks/text_generation/src/generate_text.py/0 | {
"file_path": "archai/docs/advanced_guide/cloud/azure/notebooks/text_generation/src/generate_text.py",
"repo_id": "archai",
"token_count": 746
} | 332 |
<jupyter_start><jupyter_text>Transformer++ Search Space ```{warning}This is an experimental feature and could change at any time``` This notebook shows how to use Archai's Tranformer++ search space for Language Modelling. This search space consists in 8 different token-mixing primitives that can be used to create a wid... | archai/docs/getting_started/notebooks/nlp/tfpp_ss.ipynb/0 | {
"file_path": "archai/docs/getting_started/notebooks/nlp/tfpp_ss.ipynb",
"repo_id": "archai",
"token_count": 1701
} | 333 |
API
===
Archai Model
------------
.. automodule:: archai.discrete_search.api.archai_model
:members:
:undoc-members:
Model Evaluator
---------------
.. automodule:: archai.discrete_search.api.model_evaluator
:members:
:undoc-members:
Predictor
---------
.. automodule:: archai.discrete_search.api.predic... | archai/docs/reference/api/archai.discrete_search.api.rst/0 | {
"file_path": "archai/docs/reference/api/archai.discrete_search.api.rst",
"repo_id": "archai",
"token_count": 301
} | 334 |
Configuration Utilities
=======================
ONNX Configuration (Base)
-------------------------
.. automodule:: archai.onnx.config_utils.onnx_config_base
:members:
:undoc-members:
CodeGen ONNX Configuration
--------------------------
.. automodule:: archai.onnx.config_utils.codegen_onnx_config
:members... | archai/docs/reference/api/archai.onnx.config_utils.rst/0 | {
"file_path": "archai/docs/reference/api/archai.onnx.config_utils.rst",
"repo_id": "archai",
"token_count": 166
} | 335 |
Datasets
========
.. toctree::
:maxdepth: 2
archai.supergraph.datasets.providers
Augmentation Policies
---------------------
.. automodule:: archai.supergraph.datasets.aug_policies
:members:
:undoc-members:
Augmentations
-------------
.. automodule:: archai.supergraph.datasets.augmentation
:members... | archai/docs/reference/api/archai.supergraph.datasets.rst/0 | {
"file_path": "archai/docs/reference/api/archai.supergraph.datasets.rst",
"repo_id": "archai",
"token_count": 349
} | 336 |
# Evaluating Models on HumanEval
This guide will provide step-by-step instructions to install the required dependencies and evaluate pre-trained models on HumanEval.
## Installing Dependencies
To begin, please install the required dependencies by running the following command:
```bash
pip install -r requirements.tx... | archai/scripts/eval/README.md/0 | {
"file_path": "archai/scripts/eval/README.md",
"repo_id": "archai",
"token_count": 323
} | 337 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import itertools
import pathlib
from concurrent.futures import ThreadPoolExecutor
import subprocess
import sys
from threading import Lock
import numpy as np
from PIL import Image
try:
from runstats import Statistics
except:
subprocess.c... | archai/scripts/supergraph/download_datasets/img_stats.py/0 | {
"file_path": "archai/scripts/supergraph/download_datasets/img_stats.py",
"repo_id": "archai",
"token_count": 622
} | 338 |
"""Assess the changes in rank due to change in LR"""
import argparse
import os
import pathlib
import statistics
from ast import literal_eval
import scipy
from archai.common import delimited_text, utils
def main():
default_dir = r"D:\GitHubSrc\archaiphilly\phillytools\nasbench_darts_lr0.025_wd3_b128"
parse... | archai/scripts/supergraph/nasbench101/rank_change_for_lr.py/0 | {
"file_path": "archai/scripts/supergraph/nasbench101/rank_change_for_lr.py",
"repo_id": "archai",
"token_count": 811
} | 339 |
{
"fp16": {
"enabled": true,
"initial_scale_power": 12
},
"optimizer": {
"type": "AdamW",
"params": {
"lr": 1.8e-3,
"betas": [
0.9,
0.95
],
"eps": 1e-7,
"weight_decay": 0.1
}
... | archai/scripts/trainers/deepspeed/ds_config.json/0 | {
"file_path": "archai/scripts/trainers/deepspeed/ds_config.json",
"repo_id": "archai",
"token_count": 514
} | 340 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import os
import sys
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def delete(con_str):
parser = argparse.ArgumentParser(description='Delete a model from azure using its frie... | archai/tasks/face_segmentation/aml/azure/delete.py/0 | {
"file_path": "archai/tasks/face_segmentation/aml/azure/delete.py",
"repo_id": "archai",
"token_count": 387
} | 341 |
# Readme
This folder contains some handy stuff for setting up an Azure account so you can run the code in the
[Azure](../../azure/readme.md) folder and create a docker image for running SNPE model quantization
jobs on a kubernetes cluster. You can also run this docker image in a Linux container on Windows
using the Do... | archai/tasks/face_segmentation/aml/docker/quantizer/readme.md/0 | {
"file_path": "archai/tasks/face_segmentation/aml/docker/quantizer/readme.md",
"repo_id": "archai",
"token_count": 1946
} | 342 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.