sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
307697d06394b84aa94b28d4537525f0356ec178eb0a25418cbaeab5c82a4329 | Python | 6,841 | 159 | import wandb
import roboscientist.solver.vae_solver as rs_vae_solver
import roboscientist.equation.equation as rs_equation
import roboscientist.solver.vae_solver_lib.optimize_constants as rs_optimize_constants
import roboscientist.logger.wandb_logger as rs_logger
import equation_generator as rs_equation_generator
impo... |
f55820d01c4882a84347bcb8c35ec8ce84da18cf04bac1cf7f326516aee2ba66 | Python | 6,843 | 167 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .hardnet_68 import hardnet
class BasicConv2d(nn.Module):
def __init__(self, in_planes, out_planes, kernel_size, stride=1, padding=0, dilation=1):
super(BasicConv2d, self).__init__()
self.conv = nn.Conv2d(in_p... |
d41f603b4569a8353aa516958dbdb82455ffb30583bede28d8fb3baae4363ab2 | Python | 6,846 | 233 | #!/usr/bin/env python3
#take corr network and genespace as input and create conditional LLS benchmarking data .condLLS
#Author : Junha Cha
#Date : Apr 24th 2021
#usage : ./script.py [edgelist] [genelist.txt]
#outfile format : [bin_link] [cumLLS] [TP] [FP] [Gene_Coverage] [binLLS]
import sys
import pandas as pd
impor... |
600cc229e2b453ce6fd735e85e0b3254dd26dae52b43180dabb93507d389d429 | Python | 6,847 | 169 | import torch
import cv2
import time
import os
import os.path as osp
import numpy as np
from torch.autograd import Variable
import torch.nn.functional as F
from argparse import ArgumentParser
from collections import OrderedDict
from IOUEval import iouEval
from PIL import Image
import loadData as ld
from models import Mi... |
07044f122d78b9fe43f6ee4912389049dd7438df213f703b8e6d13c76978b5f6 | Python | 6,849 | 193 | """
Refer to https://github.com/rosinality/stylegan2-pytorch/blob/master/lpips/pretrained_networks.py
Refer to https://github.com/richzhang/PerceptualSimilarity/blob/master/lpips/pretrained_networks.py
"""
from collections import namedtuple
import torch
from torchvision import models as tv
from IPython import e... |
3bf1c1709e92f05b56a69d8df802051d70a68eeddf663baa01705d8fb33f0dcb | Python | 6,849 | 228 | import pytest
import torch
from tltorch import FactorizedTensor
from ..legacy_spectral_convolution import (
SpectralConv3d,
SpectralConv2d,
SpectralConv1d,
SpectralConv,
)
@pytest.mark.parametrize(
"factorization", ["ComplexDense", "ComplexCP", "ComplexTucker", "ComplexTT"]
)
@pytest.mark.parametr... |
e2d6c24bb851612e049b48a9192f1864589571de239d72ae04fb0a3c823590af | Python | 6,850 | 243 | import os
import sys
from types import ModuleType
from typing import Optional, Tuple
import numpy as np
from ..base import DatabaseBase, ALL, load_fids, load_mat, drive_mounted
########################################################################
class Database(DatabaseBase):
""""""
fids = load_fids(os.... |
15cc63cd0580ef64e3744886439263bc62e08a895bd0adb3ebfe0bb2ecc795e0 | Python | 6,856 | 213 | __author__ = "Jianfeng Sun"
__version__ = "v1.0"
__copyright__ = "Copyright 2023"
__license__ = "GPL v3.0"
__email__ = "jianfeng.sunmt@gmail.com"
__maintainer__ = "Jianfeng Sun"
import numpy as np
import pandas as pd
from tmkit.util.Reader import Reader as greader
class Reader:
"""
A class for reading vario... |
295188bc6529e2a8108260796a7be6c21650d20950385b80f6d77f561cf51e17 | Python | 6,857 | 124 | # %%
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from pymaid_creds import url, name, password, token
from data_settings import data_date, pairs_path
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
from contools import Celltype, Celltype_Analyzer, P... |
4ce2fe031eb0735f2972254ec521521aa125ff96f7c503e9b2eac5e0d21d4fcb | Python | 6,860 | 250 | #%%
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.cluster import AgglomerativeClustering, KMeans
from sklearn.metrics import pairwise_distances
from graspy.embed import AdjacencySpectralEmbed
from graspy.models import DCSBMEstimator, ... |
8e8c8e92c03088ed55e0381e8440c5b8ce5800b0496f65b0f56cf08aec813fbc | Python | 6,864 | 226 | from typing import List, Optional, Union
from math import prod
from pathlib import Path
import torch
# Only import wandb and use if installed
wandb_available = False
try:
import wandb
wandb_available = True
except ModuleNotFoundError:
wandb_available = False
def count_model_params(model):
"""Returns... |
9bd72c0449e175a91863af28d0eff06028da6e956ae81299bffd9f1bc0a20cd3 | Python | 6,864 | 156 | """
Preparing fMRI Data
===================
In this tutorial we discuss how to prepare fMRI data. This tutorial covers:
1. Preparing group-ICA data
2. Preparing anatomically parcellated data
3. Saving and loading prepared data
fMRI data needs to be preprocessed in a particular way to train a dynamic network model (H... |
5448548d8051f161514f54666739c07b8df99e97dd6a2f5e002a68a0f25bdf54 | Python | 6,865 | 193 | import torch
from ..inference import RPNPostProcessor
from ..utils import permute_and_flatten
from maskrcnn_benchmark.modeling.box_coder import BoxCoder
from maskrcnn_benchmark.modeling.utils import cat
from maskrcnn_benchmark.structures.bounding_box import BoxList
from maskrcnn_benchmark.structures.boxlist_ops impor... |
ae081e190eaa2e4d69e8a0105968a4df239118fa544d3ea91629a1666f298b2d | Python | 6,868 | 309 | # %% [markdown]
# ##
import os
import matplotlib as mpl
# mpl.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import gaussian_kde
import pymaid
from src.data import load_metagraph
from src.graph import preprocess... |
c264d876a89877b4d64b9923398798f069d8d91533ff166b1644fdabcf752d2c | Python | 6,870 | 158 | import os
import pandas as pd
import glob
import argparse
import numpy as np
import torch
from openeye import oechem
from openeye import oegrid
from model import ViscosityNet
from utils import seed_everything
from utils import GRID_DIM_KEY, GRID_SPACING_KEY, ESP_DIR_KEY, HOMOLOGY_MODEL_DIR_KEY
from utils import get_... |
ba4a7d8a654168ab982c2debc894a202d687b2206f6e9ab7271192ed0991d732 | Python | 6,872 | 228 | from functools import partial
import jax.numpy as jnp
import numpy as np
import jax
# RL model with dynamic temperature inner loop:
#
# Obeys the standard Q-learning formulation w/ a
# softmax policy, except temperature is allowed to
# vary over time
#
# Note that this uses the jax.lax.scan mechanism
# carry variab... |
0094c866cd47f2e3c4e6c1ea9b10a8a4edc7c9d30ee73d85e061e48dea527bb2 | Python | 6,873 | 174 | #!/usr/bin/env python
# Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""Sequentially visualize the opendrive points"""
import carla
import argpa... |
1208fabcea7a870265627b9a32025aa01f493360b2fd76aea2120babc3c5e8ac | Python | 6,876 | 186 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
da706be98d1be09c4525b7befc194e0c96f0402af2b5e1fb8304db4cd142f930 | Python | 6,879 | 200 | #!/usr/bin/env python3
"""
File: rank_gene_expression.py
Created: 2020/10/28
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software ... |
a1f2c19573038d8438e73e8b64f11086d559e312078512f7c302f6b1acae7694 | Python | 6,880 | 198 | from AFQ.viz.utils import COLOR_DICT
import numpy as np
import scipy.stats as stats
import altair as alt
def altair_color_dict(names_to_include=None):
"""
Given a list of bundle names, return a dictionary of colors for each
Formatted for Altair.
"""
altair_cd = dict(COLOR_DICT.copy())
for key ... |
c730f60675738f6e4d2c9a0ede2210242d9f6358efb29eb888368ce713316b1e | Python | 6,881 | 158 | import re
from typing import Iterable, Iterator, List, Optional, Tuple
from kgcl_schema.datamodel import kgcl
from pronto import Definition
from oaklib.datamodels.synonymizer_datamodel import RuleSet, Synonymizer
from oaklib.datamodels.vocabulary import (
EXTENDED_SCOPE_TO_SYNONYM_PRED_MAP,
)
from oaklib.interfac... |
96eec567387278197ebd7f6e2d2d6c8f76ca3f710e8494a2b8351099025d8ee2 | Python | 6,883 | 210 | from enum import Enum
from linkml_runtime import CurieNamespace
import oaklib.datamodels.ontology_metadata as omd
from oaklib.datamodels.ontology_metadata import slots as omd_slots # noqa F401
WIKIDATA = CurieNamespace("wikidata", "http://www.wikidata.org/entity/")
WDP = CurieNamespace("wdp", "http://www.wikidata.o... |
0a8ed362fd862ed78a6fce60946bf682cee7373bbfea66b9509db4691f7e3b0c | Python | 6,887 | 114 | """Ego drive sequence with hood cameras: RGB (+2D/3D boxes), DVS, optical flow.
python3 drive.py OUT --start x,y,z,yaw --frames 160 --warm 80
Frames: OUT/{rgb,box2d,box3d,boxtl,dvs,flow}/NNNN.png
"""
import argparse, os, queue, sys
import numpy as np, carla
from PIL import Image, ImageDraw
sys.path.insert(0, os.path.d... |
686ca6c78eb73575d72f3d50174b4e937dc9b8ffe602f2c59b647c8b0f4be8cc | Python | 6,889 | 165 | #!/usr/bin/env python3
"""Generate the demo's copy of the frontend from the live templates and JavaScript.
Called by build_demo.py. The production frontend under app/templates/ and app/static/js/ is
never modified — it is copied here and three classes of change are applied, all of them
mechanical and listed below so t... |
f2a0fcd528100f913b1c0005b825d3d9b6194aa815e2771b193ba4575f0744c0 | Python | 6,889 | 213 | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
# +
class Flatten(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x.view(x.data.size(0),-1)
class ConvLayer(nn.Sequential):
def __init__(self, in_channels, out_channels, kernel=... |
acff71bfc9bb80dac91056d46120a4a53199c1ab68f7fcff63d4329a0bb6deb1 | Python | 6,890 | 173 | import torch
import cv2
import time
import os
import os.path as osp
import numpy as np
from torch.autograd import Variable
import torch.nn.functional as F
from argparse import ArgumentParser
from collections import OrderedDict
from IOUEval import iouEval
from PIL import Image
import loadData as ld
#from models import M... |
f1a874e0eb34d3299d1bc8dd7d51172e0958f924f87d62aa63f8f25ac65a74e2 | Python | 6,893 | 193 | from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Descriptors as desc
from rdkit.Chem import QED
import pandas as pd
from rdkit import DataStructs
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.preprocessing import MinMaxScaler as Scal... |
0fac7f496049e0b14958beb6b997a47ac3c3d502f9b120c89987d5b89ac54f58 | Python | 6,894 | 234 | """
Training script for GINO on Car CFD dataset.
This script trains a Graph Neural Operator (GINO) on computational fluid
dynamics data for car pressure prediction. The model learns to predict
pressure fields from geometric inputs using graph-based representations.
"""
import torch
import wandb
import sys
from neural... |
1fc0ce1e36068c733379914d0b3713e626673834480df950b1ad2e0f74f1f1c4 | Python | 6,895 | 140 | """Server settings, all from ``COSMOS_*`` environment variables (or CLI flags).
=========================== ===================== ===================================================
variable default meaning
=========================== ===================== =======================... |
5f39c36e17005aa007259b776c2764e65749bc8b97a49b7d4529c4abb948b5de | Python | 6,901 | 257 | #%%
from operator import itemgetter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from graspy.cluster import GaussianCluster, KMeansCluster
from graspy.embed import AdjacencySpectralEmbed, LaplacianSpectralEmbed, OmnibusEmbed
from graspy.models import DCSBMEstimator
from ... |
193d2a7542ce2757cb89406471ca3edc6b88596bd396e954ab21d2f83a9985e7 | Python | 6,905 | 225 | """
The question here is whether ferrets learn during cooling
The data loaded is from the analysis level of each project pipeline.
"""
from dataclasses import dataclass
from pathlib import Path
import os, sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
sys.path.insert(0, os.path.absp... |
3c64f4e5e5bf1cd3fec5f2d9aa7f6a3e26939f468a5cd782a321e90fddf6c203 | Python | 6,905 | 177 | # Copyright (c) Open-MMLab. All rights reserved.
import datetime
import os.path as osp
from collections import OrderedDict
import torch
import torch.distributed as dist
import mmcv
from ..hook import HOOKS
from .base import LoggerHook
@HOOKS.register_module()
class TextLoggerHook(LoggerHook):
"""Logger hook in ... |
a6bf4649341b4bebd4dbf3066df4ed4162b4482b46771dcf25d491122607e18a | Python | 6,905 | 211 | """Generative models.
This subpackage contains all the models implemented in osl-dynamics. Each
model module (e.g. ``hmm.py``, ``dynemo.py``) defines a ``Config`` dataclass
and a ``Model`` class.
Code structure
--------------
The code is organised into three layers:
**1. Base layer** (``mod_base.py``)
- :py:class:... |
4773d248eecf09cc8edef16fdb17f15fe37ee2b25b884dcdd2d4550c1dc20518 | Python | 6,907 | 207 | """One test per finding of the 1.0.0 code review, fixed in 1.0.1."""
import contextlib
import io
import json
import pkgutil
import random
import threading
from io import StringIO
import numpy as np
import pandas as pd
import pytest
import pyoxynet
from pyoxynet import utilities
_loaded = {}
def model(name='CNN'):
... |
0c173ef901d94bd7e7e1a77ac152443caeeb6924a038309cdd8009781f4225f9 | Python | 6,909 | 130 | # Copyright 2021-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
265fb7dc25b0a979c31ca26f5e9da39e5be7e5b1a6d5dc0a6b6facb02d2753ef | Python | 6,912 | 172 | from collections import OrderedDict
import csv
from typing import List, Optional, Union
import numpy as np
from tqdm import tqdm
from .predict import predict
from chemprop.args import PredictArgs, TrainArgs
from chemprop.data import get_data, get_data_from_smiles, MoleculeDataLoader, MoleculeDataset
from chemprop.uti... |
0f4c48d0861c40426c6f8e66ee404e661139d3a2233f6ec1fd77134ce0db22d6 | Python | 6,916 | 173 | #!/usr/bin/env python3
"""
File: get_sn_avg_gene_expr.py
Created: 2020/11/30
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software ... |
f900b4dd150bbece328158c2a0f323d3b92d25e41ad8415878d161a575daed23 | Python | 6,916 | 159 | import pandas as pd
import numpy as np
import ciso8601
import functions_basic_sak as funsak
import inspect
import os
import pathlib
import wget
import requests
import re
from tqdm import tqdm
import AIS_parameters
import AIS_function_wrapper
pd.set_option('display.max_columns', 20, 'display.width', 1500)... |
2533b32f9239c606c9518df0bd3a6168b562a85e7d5b8ad9d5bf992bfcb61dcf | Python | 6,917 | 189 | import torch
from torch.autograd import Variable
import os
import argparse
from datetime import datetime
from lib.HarDMSEG import HarDMSEG
from utils.dataloader import get_loader,test_dataset
from utils.utils import clip_gradient, adjust_lr, AvgMeter
import torch.nn.functional as F
import numpy as np
from torchstat imp... |
cc2b1859d584024aea47f0e4227be06572c2fd9f84f87de061cda9456653e3d5 | Python | 6,919 | 263 | """Utility classes and functions related to the models."""
import re
from typing import Any, List
def tex_escape(text: str) -> str:
"""Escape characters which require control sequences in text for use in LaTeX.
Parameters
----------
text : str
Text to be escaped.
Returns
-------
... |
fe2712ae6f6e61530d28fb9f3b0bd20b7bea3a28012d7ae0639155b3751b5949 | Python | 6,919 | 117 | """Calibrate CARLA's sun_azimuth_angle convention: a car under a top-down camera, four azimuths at 45 deg altitude,
shadow direction measured in the CARLA world frame. Writes OUT.json with the fit sun_bearing_deg = k * az + c
(sun_bearing = atan2(dir.y, dir.x) of the direction TOWARD the sun in CARLA world coordinates... |
b2d117fe729f16599aaba7291e646a7b8d95d3bcdfdf3cb09478cb85f6d10158 | Python | 6,922 | 200 | import numpy as np
import pytest
import tensorflow as tf
from typing import Callable, List, Tuple
from multi_phase import RANDOM_SEED
from multi_phase.utils.affine_transformation import AffineTransform
PCT_CORRECT_THRESHOLD = 0.6
DEFAULT_IMG_SIZE = [4, 6, 8]
NUM_HOMOGENOUS_DIMS = 3
TEST_IMG_DIMS_2D = (
[2, 64, 6... |
b8aeb96675b1c4acb995cf014181aaecdb7494e880e5cbec0e0e616023f0d433 | Python | 6,922 | 141 | import pandas as pd
import numpy as np
from ..dataset import get_seqlevel_featnames
class SeqBaselineGenerator:
def __init__(self):
pass
@classmethod
def generate_df_from_fixed_baselines(clss, df, nsamples, feat_subs_opt='theoretical_min_val'):
tindices = df.index[:nsamples]
... |
5761c18cd92d01875f2bd9143696946fadbf74fb7c911571e6cb0b6b1f15f449 | Python | 6,925 | 198 | import copy
from operator import mod
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score
import torch
from tqdm import tqdm
from train import train
from model import Quantified_2layer_CNN, Unquantified_2layer_CNN, VGGMini_CNN
from utils.function import direct_quantize
from utils.dataTra... |
19ebe0c8699b8855283682b7efd3203b0765d89498444a8a782b1125110fba5e | Python | 6,927 | 157 | """
File: Centroid_decomposition_wrapper.py
Created: 2020-05-05
Last Changed: 2021-01-08
Author(s): H.H.Wiersma
Code to create distribution plot and a mask image used in the research plan
Copyright (C) 2019 H.H.Wiersma
This program is free software: you can redistribute it and/or modify
it under the t... |
5199d47edae7b0cb3a45c271fb28f5a1e034655b36ca1e3285edf22fa5f8a2a4 | Python | 6,928 | 210 | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
28d2d573aece3dfe67780b58548a766c978c23b276df45f08589a77da45ff5fb | Python | 6,932 | 179 | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import torch
import torch.nn as nn
from functools import partial
from timm.models.vision_transformer import VisionTransformer, _cfg
from timm.models.registry import register_model
from timm.models.layers import trunc_normal_
__all__ = [
'deit_ti... |
9961fab55600729ea4f1a11867c037399f3612754689080fc7231802d57e1c2f | Python | 6,934 | 170 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
952e26dd65b888dd4141b36cfb5520324a307cf6e8e016088d6226de103a7d68 | Python | 6,936 | 157 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
16ff21196ea246a671baf70f938d5c38247599fcfe9564843030f34aa05817fb | Python | 6,937 | 180 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
4a55e04a8dc0156f57170e827a87a730adf12b5958c8ddbdb97665a262798de6 | Python | 6,938 | 234 | # -*- coding: utf-8 -*-
"""
Spyder Editor.
This is a temporary script file.
"""
from neuron import h
import matplotlib.pyplot as plt
import numpy as np
from cell_models import PyramidalCell
from scipy.signal import find_peaks
from opt import myinit, mystyle
# Make plots nicer!
plt.style.use("seaborn-colorblind")
pl... |
ced073e9f05ce83298afd7a5144a5f9c8ef6ac895c8a112bfe8d73fc0857d45e | Python | 6,939 | 179 | # Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
from . import SyncSmokeTest
import carla
import time
try:
# python 3
from queue import Que... |
d2841efbfeea478bca68465e5583c70eaa091791ed405b81ac49043667b23e79 | Python | 6,939 | 175 | import numpy as np
import os
import nibabel as nib
import cv2
import pickle
def readlabel(file):
"""
Purpose
-------------
Read the atlas label file.
Inputs
-------------
file :
Outputs
-------------
A list contains ...
"""
output_index = []
output_names = []
... |
a4dfd24c13660fa5b3c25679f3e51ed117ec72f0b1a2503c865e5bb60968737e | Python | 6,942 | 136 | import argparse
from mismatch.TNMismatchClustering import TNMismatchClustering
from mismatch.MTLSuperPoints import create_MTLSuperPoints
from mismatch.AssignGroup import AssignGroup
def parse_weights(weight_str):
weights = {}
if weight_str:
for pair in weight_str.split(","):
if ":" not in p... |
3fd275426fdf06660fd9fa8180d634a1c2b21cbbab9cf096f2bb6b8ecdf8d6ed | Python | 6,943 | 157 | """Coordinate conversions between CARLA (Unreal) and NVIDIA ClipGT (FLU) frames.
Conventions
-----------
CARLA / Unreal: left-handed, x forward, y right, z up, metres, degrees
(``carla.Rotation(pitch, yaw, roll)``). NVIDIA world scenario: right-handed
FLU, x forward, y **left**, z up, metres, quaternions ``(x, y, z, ... |
ae7b68d1a1a4fd4e67b22a5f553d5ff78b6e23e200bf01fc4986e9c785e9faa4 | Python | 6,945 | 161 | #!/usr/bin/env python3
"""Drive a vehicle to a destination with CARLA's navigation agents, or plan a route.
Commands:
route --from X,Y,Z --to X,Y,Z [--draw] [--resolution 2]
plan a route (waypoints + turn actions) with GlobalRoutePlanner; no driving
go --to X,Y,Z [selector] [--agent basic|behavior... |
6933576ffec21a2a37c960628e4792fba7b2a1e4bbbf970fc62a98989e4de48d | Python | 6,949 | 182 | ####################################################################################################
# Copyright (c) 2019 - 2023, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free... |
c014e16c386314212a71b59f868678c3f7d6fd83146d79fdb31e97b5a9413ded | Python | 6,949 | 316 | """
DISCO Convolutions
==================
This tutorial demonstrates Discrete-Continuous (DISCO) convolutions, which are
the building blocks of localized neural operator frameworks. DISCO convolutions
are crucial for:
- Learning localized patterns in data
- Handling both equidistant and unstructured grids
- Enabling... |
11fbe690952708704200df2cb35947a7dc3bf56d1f9f0fa2324ec469ed4ddfb8 | Python | 6,950 | 181 | '''
Take advantage of carpet symmetries by implementing "classes" procedure.
If a number of oscillators has the same phase - map them into one class.
Then we can solve ODE taking only 1 oscillator from each class, saving some resources.
Important:
- If two oscillators have the same phase, it doesn't in general imply t... |
a0b0713747876ddb7b5ae1932b914b043abbc3d64ad5d6deb0a139383e52f390 | Python | 6,951 | 217 | # This script will take one or more directory paths as inputs, parse the model info,
# and convert the model into a CSV description, a single directory simulation, or save into NeuroML-DB
# Can be used to modify a model that already exists in the database or import a new model into the db
# Usage examples:
# For a ne... |
ace89dcfedf51441f56032845ade91768d58bdc7d24a573a3f2765f24bda096f | Python | 6,953 | 194 | """
Access to the data description of the turtle cortical circuit obtained by Mike et al.
"""
import logging
import pandas as pd
from tctx.util import networks, track
# Baseline firing rates in turtle dorsal cortex are (median, 25, 75 percentile)
# - *ex vivo*: E: 0.01 [0, 0.05] spks/s I: 0.01 [0, 0.04] (Hemberge... |
a314206459bcb497bd9ced6224408987dd906fe19aa37509360546641986247e | Python | 6,954 | 223 | """
Refer to https://github.com/rosinality/stylegan2-pytorch/blob/master/lpips/__init__.py
Refer to https://github.com/richzhang/PerceptualSimilarity/blob/master/lpips/__init__.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np... |
c9447f4a2f9a07ab6c199c48985aaa9653353b5384ddd3ce46b49a79acdda5d4 | Python | 6,955 | 181 | import csv
import sys
import inspect
import itertools
import numpy as np
import scipy.io as sio
from itertools import zip_longest
from datetime import datetime
from scripting.spectrum.io import dialogs
from scripting.spectrum.io import paths
class CSVReader(csv.DictReader):
"""An Extended DictReader object that c... |
ff88bddfabbb2f168177f79581c9aa890ada7d4a399784b5fbdb63fb9d196243 | Python | 6,957 | 214 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import pycocotools.mask as mask_utils
# transpose
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
class Mask(object):
"""
This class is unfinished and not meant for use yet
It is supposed to contain the mask for an object as
... |
a813359a47cd92d1b96c01262a5b66689167b5230ddbfa94d8bea3805e530a2c | Python | 6,958 | 159 | import numpy as np
import argparse
import random
import sys
import os
parser = argparse.ArgumentParser(description='Simulate gene expression levels using expression ~ cc1 + cc2 + snp:cc1 + snp:cc2')
parser.add_argument('cellcount_file', help='file containing cell counts')
parser.add_argument('genotype_file', help='fil... |
3a1d6d9302e69ba0f544c57faf9029ea26543d429e39e5e22c1402ec52f50a50 | Python | 6,959 | 174 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
eb247ce55fc3094b645de988d5a0ab19c7e4b8ce8b738de5e8bb75f6aa3e0ea4 | Python | 6,959 | 134 | """Side-by-side viewer: input RGB | control(s) | Cosmos result, per camera, with scrubbing — and mp4 export.
python viewer.py --clip clips/<id> --result results/<id>/<job> # or: viewer.py --result DIR (clip from manifest)
python viewer.py --clip clips/<id> # no result yet:... |
ab50691e1b1772ff62296d48b3cb7eb6dfe24f2a53eb3cb8460ee48ac126533c | Python | 6,960 | 204 | """A reasoner that computes entailed edges."""
import logging
import subprocess
from dataclasses import dataclass, field
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import List, Optional, TextIO
from oaklib import BasicOntologyInterface
from oaklib.datamodels.vocabulary import (
D... |
86d1371ff976ff029716dcfdc18c4c01604c3e4cd8e7e3997a1bd880b00079f2 | Python | 6,962 | 133 | import time
from carla_cosmos.contracts import JobRequest
from carla_cosmos_server.scheduler import ERROR_TEXT_LIMIT, failure_text
from carla_cosmos_server.store import Store
from conftest import submission, upload
def _mk_store(tmp_path):
return Store(tmp_path / "db.sqlite", tmp_path / "blobs", tmp_path / "job... |
beee6b53748a2d776e8640fe2b3e3209b5a6bcf09100af6e213db5811a2392ba | Python | 6,967 | 173 | import torch
import os
import argparse
import pandas as pd
import numpy as np
import random
from src.preprocess import standardize, train_valid_test_split, remove_long_sequences
from src.invalidSMILES import get_invalid_smiles
from src.modelling import initialize_model, train_model, correct_SMILES
def ArgParser():... |
d961997e46f2bca2c6676a5263ad30999c9ea0b45d6d03f322f2cf52e7da7a21 | Python | 6,967 | 174 | # -*- coding: utf-8 -*-
import numpy as np
from itertools import tee
from sklearn import metrics
from . import embed
from . import utils
from ._base import _DirectCausality
class _EmbeddingCausality2(object):
def __init__(self, embed_dim, lag=1, n_neighbor=None, n_excluded=0):
assert isinstance(embed_dim... |
36e5d877c54382d92c901ed36235727d958ded54c9e66271d35adfea3b8bed24 | Python | 6,968 | 168 | #!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2022--, Bojing Jia.
#
# Distributed under the terms of the GPLv3 license.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------------... |
84e40cdd6b87603239418f8b87beec8a1d1e93c2e27509f0b427698c29124a3a | Python | 6,968 | 162 | #!/usr/bin/env python3
"""
File: CellMap_CTInteractions.py
Created: 2020/09/16
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softwar... |
dcad96e0f715c210b77eb9e69a659990db7391db2f9ff24b51724b16cafd9889 | Python | 6,969 | 222 | import numpy as np
import os.path as op
from time import time
import logging
from dipy.io.stateful_tractogram import StatefulTractogram, Space
from dipy.io.streamline import save_tractogram
import dipy.tracking.streamlinespeed as dps
import dipy.tracking.streamline as dts
from dipy.tracking.distances import bundles_d... |
166b4bc7679badea31daee1b9e605c4cd7dd910e399ccf6a3f8efd1f2da1d4c7 | Python | 6,977 | 165 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
c53c6a75cf710b8c252a1cb92ca96846d2e415df36dbb52f9093a0fdbb1b0588 | Python | 6,977 | 181 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
1ccc436821e4ddf584b4ba7e1183b027a01e1146a9546f761a79b7ba1b3fdd55 | Python | 6,980 | 200 | import torch
import random
import numpy as np
import networkx as nx
from typing import Optional
import matplotlib.pyplot as plt
from torch_geometric.data import Data
from torch_geometric.utils import k_hop_subgraph
from sklearn.model_selection import train_test_split
from graphxai.datasets.dataset import NodeDataset... |
e4666ad3bf7ea24b331c1ddf4ae641dc85f2d6cd38b313b9ce467a2607e25da8 | Python | 6,980 | 201 | #!/usr/bin/env python3
"""
File: prepare_matrix.py
Created: 2020/10/20
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Founda... |
2dae456874cb3d495f9d621e35c02d88df5269ffd6901a3567427b6ac068838a | Python | 6,981 | 162 | #!/usr/bin/env python3
"""
File: CellMap_CTInteractions.py
Created: 2020/09/16
Last Changed: 2022/02/10
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the F... |
7664584e9108078dabcbd1f52b822b16d6889dc9a681cf886755f55b9f021f7d | Python | 6,982 | 248 | import argparse
import math
import os
import torch
from torch import optim
from torch.nn import functional as F
from torchvision import transforms
from PIL import Image
from tqdm import tqdm
import lpips
from model import Generator
def noise_regularize(noises):
loss = 0
for noise in noise... |
e399be61b1729f5b88248f06296b1cc7b6a14bd5e07dae0c4e96a950b144ae26 | Python | 6,982 | 151 | import csv
import io
import numpy as np
import pandas as pd
import pyqtgraph as pg
from PyQt5 import uic
from PyQt5.QtCore import pyqtSlot, QPoint, QTimer, Qt, QByteArray
from PyQt5.QtGui import QCloseEvent, QIcon
from PyQt5.QtWidgets import QWidget, QFileDialog
import LoggingDialog as ld
import SensorServiceItem as ... |
2105e96adf18ea368b34677bb9910f0f7af2b7a88f52a7450d4afa42baddbfe4 | Python | 6,988 | 190 | import torch
import torch.nn as nn
import numpy as np
from typing import List
from config import cfg
class ImageBasedCrossEntropyLoss2d(nn.Module):
def __init__(self, classes, weight=None, size_average=True, ignore_index=255,
norm=False, upper_bound=1.0):
super(ImageBasedCrossEntropyLoss2... |
bbdaa3a7ab54ee4289e055dab916ab613206b556cccfe9136a52aa97a5b56565 | Python | 6,988 | 187 | from __future__ import print_function
# Import libraries
import math
import os
import numpy as np
import cv2
import pickle
from collections import OrderedDict
from tabulate import tabulate
# 3d Brain
import vedo
vedo.settings.embedWindow(backend=False, verbose=True)
from .ObjSave import probe_obj, save_probe
f... |
caf8dc835e0cc0d19154107618b83e46e4b6c3ca07618931914df368e50e1f2f | Python | 6,989 | 237 | # -*- coding: utf-8 -*-
"""
Spyder Editor.
This is a temporary script file.
"""
from neuron import h
import matplotlib.pyplot as plt
import numpy as np
from cell_models import PyramidalCell
from scipy.signal import find_peaks
from opt import myinit, mystyle
# Make plots nicer!
plt.style.use("tableau-colorblind10")
... |
15a3ca8524dafe68749403239ff81edee142a9b8629d4315be19104ac1dd97bb | Python | 6,990 | 215 | """
turtle model with spatial component
"""
import pandas as pd
import numpy as np
import scipy.stats as st
import copy
from tctx.util.profiling import log_time
from tctx.util.networks import MutableNetwork, merge_dicts
import logging
from tctx.networks import space, turtle_data
import tctx.networks.base
import scip... |
3dc6531580dda279ee9b69b5c9d6ef5b2a166b90f0a8a2159bfcf945e4bb0b6b | Python | 6,994 | 224 | import matplotlib.pyplot as plt
import pathlib
import json
import seaborn as sns
import numpy as np
from datetime import datetime
from helper.misc import infer_and_accuracy, clear_print
from helper.data import load_data, get_architecture
from mip.get_nn import get_nn
colors = sns.color_palette("Set1", 4)
reg_colors = ... |
7ce2b58a7ae4bb3d29afac30f6ca176dff41588742c3aaca3ccf14f5bcb93485 | Python | 6,994 | 187 | #!/usr/bin/env python
# Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""Five-camera AV rig demo with optional DLSS Super Resolution.
Spawns an au... |
ecbad8ab331411094d95a6081be32185eb1731e3cff338ca78c0a800b431df00 | Python | 6,994 | 171 | import torch
import torch.nn as nn
import torch.nn.functional as F
from models.baselines.segbase import SegBaseModel
__all__ = ['InfNet']
class InfNet(SegBaseModel):
def __init__(self, classes=2, aux=False, backbone='resnet50', pretrained_base=True):
super(InfNet, self).__init__()
self.num_class... |
5b4acf776b9ec302b489af5ba9a733d0baaa9b1af944473a676482a1ede7062a | Python | 6,995 | 190 | import torch
import torch.nn as nn
import torch.nn.functional as F
class FastSal(nn.Module):
def __init__(self, classes=2, aux=False, pretrained='MobileNetV1_pretrain.pth'):
super(FastSal, self).__init__()
self.context_path = MobileNetV1(pretrained)
if pretrained is not None:
s... |
959914d0f5aa08671293063fccfb7d5f7893145dfd61013fb6c21b9205a1f6a6 | Python | 6,996 | 189 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module containing useful functions for extracting fluorescence traces.
Created on Thu Jun 6 14:49:55 2019
@author: nicolas
"""
import os.path
import warnings
import pickle
import numpy as np
import matplotlib.pyplot as plt
from skimage import io
def get_fluoropho... |
ceeb8039c3fb1b517f485fe368140021d2bd569bbfc7aedeb1d7aa30fcd4b95c | Python | 6,997 | 167 | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import normal_init
from mmcv.ops import batched_nms
from ..builder import HEADS
from .anchor_head import AnchorHead
from .rpn_test_mixin import RPNTestMixin
@HEADS.register_module()
class RPNHead(RPNTestMixin, AnchorHead):
"""RPN he... |
e33276df76c2d4e950e4890a0f78db0f095352ca6494e8f247eaf9926ba533ea | Python | 7,002 | 235 | """
Grid Embeddings
===============
Grid embeddings encode spatial coordinates in neural operators, helping models understand geometric structure. This tutorial shows how to use:
- 2D and N-dimensional grid embeddings
- Custom coordinate systems
- Different embedding types for various domains
Grid embeddings are key... |
3b5a79388091d00dd6b365acf11487c19afb635d81a00a8733c68685d01464b3 | Python | 7,003 | 170 | import itertools
import time
from math import sqrt
from typing import List
import logging
import numpy as np
from numba import njit
from skimage import measure
from lib import utils
logger = logging.getLogger(__name__)
def colocalise_pairwise(channels, config):
"""Computes the colocalisation for each pair of ... |
1cecf453a080c378bef1f20a5af423f5c4d5813bc81ee9ed8bb81c54f11b1bdf | Python | 7,004 | 166 | """
File: mask_matrices.py
Created: 2020/03/12
Last Changed: 2020/03/23
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... |
630b2d892867b30573d4c46f9912706f2a95abfd73faa316c22dd73e25ccde9d | Python | 7,004 | 184 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
9b73808577a86ec89be16e5c9cd0c65360d50c87f355f00d16e753a102916127 | Python | 7,004 | 178 | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
45b130afee3163fcb5b7962ca3c92d20a7a7afe05bedbf9669c1ab83d889edb3 | Python | 7,006 | 194 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
01ff2f79b0b492fecc9055717f4d9bcb4af3600b2d0255dd36c4bb976e21b4c8 | Python | 7,008 | 215 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
ae08e79bce1255925ba842d225c1450630bd31f211091bcae1ae0239e22f5dd8 | Python | 7,008 | 163 | import datetime
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import seaborn as sns
import torch
from scipy import stats
from benchnirs.load import load_dataset
from benchnirs.process import process_epochs, extract_features
from benchnirs.learn import machine_learn, deep_learn
ALL... |
f5d59be3ee3d3aa91db6a784208938255fe31520da16c7ae822807e2975709ab | Python | 7,009 | 164 | import pickle
import time
import matplotlib.pyplot as plt
import numpy as np
import torch
import torchvision
import torchvision.datasets as dset
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision import transforms
#import seaborn as sns
from model import Siamese
from mydataset ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.