id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
163,729 | from asdl.hypothesis import Hypothesis
from asdl.transition_system import ApplyRuleAction, GenTokenAction
from asdl.sql.sql_transition_system import SelectColumnAction, SelectTableAction
class ActionInfo(object):
"""sufficient statistics for making a prediction of an action at a time step"""
def __init__(self, ... | null |
163,753 | import os, json, pickle, argparse, sys, time
from asdl.asdl import ASDLGrammar
from asdl.transition_system import TransitionSystem
from asdl.action_info import get_action_infos
from preprocess.common_utils import Preprocessor
def process_tables(processor, tables_list, output_path=None, verbose=False):
tables = {}
... | null |
163,754 | import os, json, pickle, argparse, sys, time
from asdl.asdl import ASDLGrammar
from asdl.transition_system import TransitionSystem
from asdl.action_info import get_action_infos
from preprocess.common_utils import Preprocessor
def process_example(processor, entry, db, trans, verbose=False):
# preprocess raw tokens, ... | null |
163,755 | import os, sqlite3
import numpy as np
import stanza, torch
from nltk.corpus import stopwords
from itertools import product, combinations
from utils.constants import MAX_RELATIVE_DIST
def is_number(s):
try:
float(s)
return True
except ValueError:
return False | null |
163,756 | import os, sqlite3
import numpy as np
import stanza, torch
from nltk.corpus import stopwords
from itertools import product, combinations
from utils.constants import MAX_RELATIVE_DIST
The provided code snippet includes necessary dependencies for implementing the `quote_normalization` function. Write a Python function `... | Normalize all usage of quotation marks into a separate \" |
163,761 | import os, json, pickle, argparse, sys, time
from preprocess.graph_utils import GraphProcessor
def process_dataset_graph(processor, dataset, tables, method, output_path=None, skip_large=False):
processed_dataset = []
for idx, entry in enumerate(dataset):
db = tables[entry['db_id']]
if skip_larg... | null |
163,762 | import sys, os, json, pickle, argparse, time, torch
from argparse import Namespace
from preprocess.process_dataset import process_tables, process_dataset
from preprocess.process_graphs import process_dataset_graph
from preprocess.common_utils import Preprocessor
from preprocess.graph_utils import GraphProcessor
from ut... | null |
163,764 | import sys, os, time, json, gc
from argparse import Namespace
from utils.args import init_args
from utils.hyperparams import hyperparam_path
from utils.initialization import *
from utils.example import Example
from utils.batch import Batch
from utils.optimization import set_optimizer
from model.model_utils import Regis... | null |
163,771 | import copy, math
import torch
import torch.nn as nn
import torch.nn.utils.rnn as rnn_utils
from torch.nn import functional as F
The provided code snippet includes necessary dependencies for implementing the `clones` function. Write a Python function `def clones(module, N)` to solve the following problem:
Produce N id... | Produce N identical layers. |
163,772 | import copy, math
import torch
import torch.nn as nn
import torch.nn.utils.rnn as rnn_utils
from torch.nn import functional as F
def lens2mask(lens):
bsize = lens.numel()
max_len = lens.max()
masks = torch.arange(0, max_len).type_as(lens).to(lens.device).repeat(bsize, 1).lt(lens.unsqueeze(1))
masks.req... | null |
163,773 | import copy, math
import torch
import torch.nn as nn
import torch.nn.utils.rnn as rnn_utils
from torch.nn import functional as F
def mask2matrix(mask):
col_mask, row_mask = mask.unsqueeze(-1), mask.unsqueeze(-2)
return col_mask & row_mask | null |
163,774 | import copy, math
import torch
import torch.nn as nn
import torch.nn.utils.rnn as rnn_utils
from torch.nn import functional as F
The provided code snippet includes necessary dependencies for implementing the `tile` function. Write a Python function `def tile(x, count, dim=0)` to solve the following problem:
Tiles x on... | Tiles x on dimension dim count times. E.g. [1, 2, 3], count=2 ==> [1, 1, 2, 2, 3, 3] [[1, 2], [3, 4]], count=3, dim=1 ==> [[1, 1, 1, 2, 2, 2], [3, 3, 3, 4, 4, 4]] Different from torch.repeat |
163,775 | import copy, math
import torch
import torch.nn as nn
import torch.nn.utils.rnn as rnn_utils
from torch.nn import functional as F
The provided code snippet includes necessary dependencies for implementing the `rnn_wrapper` function. Write a Python function `def rnn_wrapper(encoder, inputs, lens, cell='lstm')` to solve ... | @args: encoder(nn.Module): rnn series bidirectional encoder, batch_first=True inputs(torch.FloatTensor): rnn inputs, [bsize x max_seq_len x in_dim] lens(torch.LongTensor): seq len for each sample, allow length=0, padding with 0-vector, [bsize] @return: out(torch.FloatTensor): output of encoder, bsize x max_seq_len x hi... |
163,776 | import torch
import numpy as np
from utils.example import Example, get_position_ids, get_position_ids_drop
from utils.constants import PAD, UNK
from model.model_utils import lens2mask, cached_property
import torch.nn.functional as F
def from_example_list_base(ex_list, device='cpu', train=True):
"""
question... | New fields: batch.lens, batch.max_len, batch.relations, batch.relations_mask |
163,777 | import torch
import numpy as np
from utils.example import Example, get_position_ids, get_position_ids_drop
from utils.constants import PAD, UNK
from model.model_utils import lens2mask, cached_property
import torch.nn.functional as F
def from_example_list_base_drop(ex_list, device='cpu', train=True):
"""
que... | New fields: batch.lens, batch.max_len, batch.relations, batch.relations_mask |
163,790 | import os
import re
import string
from collections import Counter
import json
import sacrebleu
import torch
import tqdm
from rouge import Rouge
from torch.utils.data import DataLoader
from transformers import AdamW, get_scheduler
import transformers
from modelscope.hub.snapshot_download import snapshot_download
from mo... | null |
163,791 | import torch
import copy
import tqdm
import json
import os
import copy
import re
import pytorch_lightning as pl
from PIL import Image
from einops import rearrange
from pace.config import ex
from pace.modules import TransformerSS , TransformerSSDecode
from pace.transforms import pixelbert_transform
from pace.utils.forma... | null |
163,792 | import torch
import copy
import tqdm
import json
import os
import copy
import re
import pytorch_lightning as pl
from PIL import Image
from einops import rearrange
from pace.config import ex
from pace.modules import TransformerSS , TransformerSSDecode
from pace.transforms import pixelbert_transform
from pace.utils.forma... | null |
163,793 | import re
def detokenize(tk_list):
r_list = []
for tk in tk_list:
if tk.startswith('##') :
if len(r_list) > 0:
r_list[-1] = r_list[-1] + tk[2:]
else:
r_list.append(tk[2:])
else:
r_list.append(tk)
tk_list = r_list
r_list... | null |
163,801 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | [B, M, D], [B, N, D], [B, M], [B, N] |
163,802 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,803 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,804 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,805 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,806 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,807 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,808 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,809 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,810 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,811 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,812 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,813 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,814 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,815 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,816 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,817 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,818 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,819 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import glob
import json
import tqdm
import functools
import random
from collections import defaultdict
from torch.utils.data.distributed import DistributedSampler
from torch.nn.modules.loss import _Loss
from einops import rearrange
from sklear... | null |
163,820 | import torch
import random
from transformers.optimization import AdamW
from transformers import (
get_polynomial_decay_schedule_with_warmup,
get_cosine_schedule_with_warmup,
)
from pace.modules.dist_utils import all_gather
from pace.modules.objectives import compute_irtr_recall
from pace.gadgets.my_metrics impo... | null |
163,821 | import torch
import random
from transformers.optimization import AdamW
from transformers import (
get_polynomial_decay_schedule_with_warmup,
get_cosine_schedule_with_warmup,
)
from pace.modules.dist_utils import all_gather
from pace.modules.objectives import compute_irtr_recall
from pace.gadgets.my_metrics impo... | null |
163,822 | import torch
import random
from transformers.optimization import AdamW
from transformers import (
get_polynomial_decay_schedule_with_warmup,
get_cosine_schedule_with_warmup,
)
from pace.modules.dist_utils import all_gather
from pace.modules.objectives import compute_irtr_recall
from pace.gadgets.my_metrics impo... | null |
163,823 | import torch
import random
from transformers.optimization import AdamW
from transformers import (
get_polynomial_decay_schedule_with_warmup,
get_cosine_schedule_with_warmup,
)
from pace.modules.dist_utils import all_gather
from pace.modules.objectives import compute_irtr_recall
from pace.gadgets.my_metrics impo... | null |
163,824 | import torch
import random
from transformers.optimization import AdamW
from transformers import (
get_polynomial_decay_schedule_with_warmup,
get_cosine_schedule_with_warmup,
)
from pace.modules.dist_utils import all_gather
from pace.modules.objectives import compute_irtr_recall
from pace.gadgets.my_metrics impo... | null |
163,827 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | My custom 'small' ViT model. Depth=8, heads=8= mlp_ratio=3. |
163,828 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Base (ViT-B/16) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-1k weights fine-tuned from in21k @ 224x224, source https://github.com/google-research/vision_transformer. |
163,829 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Base (ViT-B/32) from original paper (https://arxiv.org/abs/2010.11929). No pretrained weights. |
163,830 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Base model (ViT-B/16) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-1k weights fine-tuned from in21k @ 384x384, source https://github.com/google-research/vision_transformer. |
163,831 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Base model (ViT-B/32) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-1k weights fine-tuned from in21k @ 384x384, source https://github.com/google-research/vision_transformer. |
163,832 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Large model (ViT-L/32) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-1k weights fine-tuned from in21k @ 224x224, source https://github.com/google-research/vision_transformer. |
163,833 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Large model (ViT-L/32) from original paper (https://arxiv.org/abs/2010.11929). No pretrained weights. |
163,834 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Large model (ViT-L/16) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-1k weights fine-tuned from in21k @ 384x384, source https://github.com/google-research/vision_transformer. |
163,835 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Large model (ViT-L/32) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-1k weights fine-tuned from in21k @ 384x384, source https://github.com/google-research/vision_transformer. |
163,836 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Base model (ViT-B/16) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-21k weights @ 224x224, source https://github.com/google-research/vision_transformer. |
163,837 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Base model (ViT-B/32) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-21k weights @ 224x224, source https://github.com/google-research/vision_transformer. |
163,838 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Large model (ViT-L/16) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-21k weights @ 224x224, source https://github.com/google-research/vision_transformer. |
163,839 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Large model (ViT-L/32) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-21k weights @ 224x224, source https://github.com/google-research/vision_transformer. |
163,840 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | ViT-Huge model (ViT-H/14) from original paper (https://arxiv.org/abs/2010.11929). ImageNet-21k weights @ 224x224, source https://github.com/google-research/vision_transformer. NOTE: converted weights not currently available, too large for github release hosting. |
163,841 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | R50+ViT-B/16 hybrid model from original paper (https://arxiv.org/abs/2010.11929). ImageNet-21k weights @ 224x224, source https://github.com/google-research/vision_transformer. |
163,842 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | R50+ViT-B/16 hybrid from original paper (https://arxiv.org/abs/2010.11929). ImageNet-1k weights fine-tuned from in21k @ 384x384, source https://github.com/google-research/vision_transformer. |
163,843 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | Custom ViT small hybrid w/ ResNet26D stride 32. No pretrained weights. |
163,844 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | Custom ViT small hybrid w/ ResNet50D 3-stages, stride 16. No pretrained weights. |
163,845 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | Custom ViT base hybrid w/ ResNet26D stride 32. No pretrained weights. |
163,846 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | Custom ViT base hybrid w/ ResNet50D stride 32. No pretrained weights. |
163,847 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | DeiT-tiny model @ 224x224 from paper (https://arxiv.org/abs/2012.12877). ImageNet-1k weights from https://github.com/facebookresearch/deit. |
163,848 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | DeiT-small model @ 224x224 from paper (https://arxiv.org/abs/2012.12877). ImageNet-1k weights from https://github.com/facebookresearch/deit. |
163,849 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | DeiT base model @ 224x224 from paper (https://arxiv.org/abs/2012.12877). ImageNet-1k weights from https://github.com/facebookresearch/deit. |
163,850 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | DeiT base model @ 384x384 from paper (https://arxiv.org/abs/2012.12877). ImageNet-1k weights from https://github.com/facebookresearch/deit. |
163,851 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | DeiT-tiny distilled model @ 224x224 from paper (https://arxiv.org/abs/2012.12877). ImageNet-1k weights from https://github.com/facebookresearch/deit. |
163,852 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | DeiT-small distilled model @ 224x224 from paper (https://arxiv.org/abs/2012.12877). ImageNet-1k weights from https://github.com/facebookresearch/deit. |
163,853 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | DeiT-base distilled model @ 224x224 from paper (https://arxiv.org/abs/2012.12877). ImageNet-1k weights from https://github.com/facebookresearch/deit. |
163,854 | import math
import logging
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import hashlib
import os
import urllib
import warnings
from functools import partial
from tqdm import tqdm
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.models.helper... | DeiT-base distilled model @ 384x384 from paper (https://arxiv.org/abs/2012.12877). ImageNet-1k weights from https://github.com/facebookresearch/deit. |
163,855 | import torch
import os
import json
from pytorch_lightning import LightningDataModule
from torch.utils.data import DataLoader
from transformers import (
DataCollatorForLanguageModeling,
DataCollatorForWholeWordMask,
BertTokenizer,
AutoTokenizer
)
def get_pretrained_tokenizer(from_pretrained, special_tok... | null |
163,856 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
def config():
exp_name = "pace"
seed = 0
datasets = ["photochat"] #,"f30k","coco"] # ["coco", "vg", "sbu", "gcc"]
loss_names = _loss_names({"itm": 1, "mlm": 1})
batch_size = 4096 # this is a desired batch size;... | null |
163,857 | from sacred import Experiment
from pace.modules import decode_utils
def env_water():
data_root = "/data/dataset"
log_dir = "/result"
# max_text_len = 120
num_gpus = 7
num_nodes = 1 | null |
163,858 | from sacred import Experiment
from pace.modules import decode_utils
def env_8():
data_root = "/data/dataset"
log_dir = "/result"
# max_text_len = 120
num_gpus = 8
num_nodes = 1 | null |
163,859 | from sacred import Experiment
from pace.modules import decode_utils
def env_debug():
data_root = "/data/dataset"
log_dir = "/result"
# max_text_len = 120
num_gpus = 1
num_nodes = 1 | null |
163,860 | from sacred import Experiment
from pace.modules import decode_utils
def env_yzc():
data_root = "/data/datasets/"
log_dir = "/result"
max_image_len = 200
max_text_len = 80
num_gpus = 1
num_nodes = 1
max_epoch = 1000 | null |
163,861 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,862 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,863 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
def task_mlm_itm_mpp():
exp_name = "mlm_itm_mpp"
datasets = ["coco", "vg", "sbu", "gcc"]
loss_names = _loss_names({"itm": 1, "mlm": 1, "mpp": 1})
batch_size = 4096
max_epoch = 10
max_image_len = 200 | null |
163,864 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,865 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,866 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,867 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,868 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
def task_finetune_mmconvdst_randaug():
exp_name = "finetune_mmconvdst_randaug"
datasets = ["mmconvdst"]
train_transform_keys = ["pixelbert_randaug"]
loss_names = _loss_names({"dst": 1})
batch_size = 256
max_... | null |
163,869 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
def task_finetune_irtr_photochat():
exp_name = "finetune_irtr_photochat"
datasets = ["photochat"]
loss_names = _loss_names({"itm": 0.5, "irtr": 1})
batch_size = 256
# max_text_len = 80
max_epoch = 10
max... | null |
163,870 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,871 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,872 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,873 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
def task_finetune_nlvr2():
exp_name = "finetune_nlvr2"
datasets = ["nlvr2"]
loss_names = _loss_names({"nlvr2": 1})
batch_size = 128
max_epoch = 10
max_steps = None
warmup_steps = 0.1
draw_false_image... | null |
163,874 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,875 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,876 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,877 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,878 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,879 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,880 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,881 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,882 | from sacred import Experiment
from pace.modules import decode_utils
def _loss_names(d):
ret = {
"itm": 0,
"mlm": 0,
"mpp": 0,
"vqa": 0,
"nlvr2": 0,
"irtr": 0,
"dst": 0,
"rg": 0,
"intent":0,
"dense":0,
"seq2seq":0
}
ret.u... | null |
163,883 | from sacred import Experiment
from pace.modules import decode_utils
def step25k():
max_epoch = 100
max_steps = 25000 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.