repo stringlengths 3 91 | file stringlengths 16 152 | code stringlengths 0 3.77M | file_length int64 0 3.77M | avg_line_length float64 0 16k | max_line_length int64 0 273k | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
OpenPSG | OpenPSG-main/openpsg/utils/vis_tools/detectron_viz.py | import colorsys
import math
import cv2
import matplotlib as mpl
import matplotlib.colors as mplc
import numpy as np
import pycocotools.mask as mask_util
import torch
from detectron2.data.catalog import MetadataCatalog
from detectron2.structures import (BitMasks, Boxes, BoxMode, Keypoints,
... | 41,496 | 41.343878 | 100 | py |
OpenPSG | OpenPSG-main/openpsg/utils/vis_tools/datasets.py | from pathlib import Path
from detectron2.data import DatasetCatalog, MetadataCatalog
from .preprocess import load_json
from .viz import get_colormap
data_dir = Path('data')
# COCO
coco_dir = data_dir / 'coco'
# coco_img_train_dir = coco_dir / 'train2017'
# coco_img_val_dir = coco_dir / 'val2017'
coco_detectron_dir =... | 3,835 | 29.444444 | 72 | py |
OpenPSG | OpenPSG-main/openpsg/utils/vis_tools/viz.py | from pathlib import Path
from typing import Any, Dict, List, Tuple
import cv2
import graphviz
import numpy as np
from detectron2.data import Metadata
from detectron2.data.detection_utils import read_image
from detectron2.data.transforms import ScaleTransform
from detectron2.utils.colormap import colormap
from detectro... | 26,878 | 28.408096 | 80 | py |
OpenPSG | OpenPSG-main/openpsg/utils/vis_tools/__init__.py | from .datasets import init_coco_panoptic_dataset, init_vg_dataset, init_vrr_vg_dataset, init_gqa_dataset
from .detectron_viz import Visualizer
from .postprocess import process_gqa_and_coco, process_vrr_and_coco, process_vg_and_coco, compute_gqa_coco_overlap, psg_to_kaihua
from .preprocess import process_vg_150_to_detec... | 812 | 53.2 | 143 | py |
OpenPSG | OpenPSG-main/openpsg/utils/vis_tools/preprocess.py | import json
from pathlib import Path
from typing import Tuple
import h5py
import numpy as np
import xmltodict
from detectron2.data.transforms import ScaleTransform
from tqdm import tqdm
def x1y1wh_to_xyxy(xywh):
"""Convert [x1 y1 w h] box format to [x1 y1 x2 y2] format."""
if isinstance(xywh, (list, tuple)):... | 20,965 | 31.00916 | 82 | py |
OpenPSG | OpenPSG-main/openpsg/utils/vis_tools/postprocess.py | from collections import Counter, defaultdict
from pathlib import Path
import cv2
import h5py
import numpy as np
from detectron2.data import DatasetCatalog
from detectron2.data.detection_utils import read_image
from detectron2.data.transforms import ScaleTransform
from detectron2.structures import BitMasks, Boxes, pair... | 21,934 | 30.789855 | 79 | py |
OpenPSG | OpenPSG-main/configs/gpsnet/panoptic_fpn_r50_fpn_1x_sgdet_psg.py | _base_ = [
'../motifs/panoptic_fpn_r50_fpn_1x_predcls_psg.py',
]
model = dict(
relation_head=dict(
type='GPSHead',
head_config=dict(
# NOTE: Evaluation type
use_gt_box=False,
use_gt_label=False,
),
),
roi_head=dict(bbox_head=dict(type='SceneGr... | 928 | 19.195652 | 63 | py |
OpenPSG | OpenPSG-main/configs/gpsnet/panoptic_fpn_r101_fpn_1x_sgdet_psg.py | _base_ = './panoptic_fpn_r50_fpn_1x_sgdet_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
# Log config
project_name = 'openpsg'
expt_name = 'gpsnet_panoptic_fpn_r101_fpn_1x_sgdet_psg'
work_dir = f'./work_dirs/{expt_name}'
log_config = di... | 671 | 23.888889 | 94 | py |
OpenPSG | OpenPSG-main/configs/gpsnet/panoptic_fpn_r50_fpn_1x_predcls_psg.py | _base_ = [
'../motifs/panoptic_fpn_r50_fpn_1x_predcls_psg.py',
]
model = dict(relation_head=dict(
type='GPSHead',
head_config=dict(
# NOTE: Evaluation type
use_gt_box=True,
use_gt_label=True,
),
))
evaluation = dict(interval=1,
metric='predcls',
... | 992 | 22.642857 | 72 | py |
OpenPSG | OpenPSG-main/configs/gpsnet/panoptic_fpn_r101_fpn_1x_predcls_psg.py | _base_ = './panoptic_fpn_r50_fpn_1x_predcls_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
# Log config
project_name = 'openpsg'
expt_name = 'gpsnet_panoptic_fpn_r101_fpn_1x_predcls_psg'
work_dir = f'./work_dirs/{expt_name}'
log_config ... | 675 | 24.037037 | 94 | py |
OpenPSG | OpenPSG-main/configs/imp/panoptic_fpn_r50_fpn_1x_sgdet_psg.py | _base_ = [
'../motifs/panoptic_fpn_r50_fpn_1x_predcls_psg.py',
]
model = dict(relation_head=dict(
type='IMPHead',
head_config=dict(
# NOTE: Evaluation type
use_gt_box=False,
use_gt_label=False,
num_iter=2,
),
))
evaluation = dict(
interval=1,
metric='sgdet',
... | 1,084 | 21.142857 | 55 | py |
OpenPSG | OpenPSG-main/configs/imp/panoptic_fpn_r101_fpn_1x_sgdet_psg.py | _base_ = './panoptic_fpn_r50_fpn_1x_sgdet_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
# Log config
project_name = 'openpsg'
expt_name = 'imp_panoptic_fpn_r101_fpn_1x_sgdet_psg'
work_dir = f'./work_dirs/{expt_name}'
log_config = dict(... | 668 | 23.777778 | 94 | py |
OpenPSG | OpenPSG-main/configs/imp/panoptic_fpn_r50_fpn_1x_predcls_psg.py | _base_ = [
'../motifs/panoptic_fpn_r50_fpn_1x_predcls_psg.py',
]
model = dict(relation_head=dict(
type='IMPHead',
head_config=dict(
# NOTE: Evaluation type
use_gt_box=True,
use_gt_label=True,
num_iter=2,
),
))
evaluation = dict(interval=1,
metric='pred... | 1,071 | 22.822222 | 55 | py |
OpenPSG | OpenPSG-main/configs/imp/panoptic_fpn_r101_fpn_1x_predcls_psg.py | _base_ = './panoptic_fpn_r50_fpn_1x_predcls_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
# Log config
project_name = 'openpsg'
expt_name = 'imp_panoptic_fpn_r101_fpn_1x_predcls_psg'
work_dir = f'./work_dirs/{expt_name}'
log_config = d... | 765 | 25.413793 | 94 | py |
OpenPSG | OpenPSG-main/configs/vctree/panoptic_fpn_r50_fpn_1x_sgdet_psg.py | _base_ = [
'../motifs/panoptic_fpn_r50_fpn_1x_predcls_psg.py',
]
model = dict(
relation_head=dict(
type='VCTreeHead',
head_config=dict(
# NOTE: Evaluation type
use_gt_box=False,
use_gt_label=False,
),
),
roi_head=dict(bbox_head=dict(type='Scen... | 1,200 | 23.02 | 63 | py |
OpenPSG | OpenPSG-main/configs/vctree/panoptic_fpn_r101_fpn_1x_sgdet_psg.py | _base_ = './panoptic_fpn_r50_fpn_1x_sgdet_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
# Log config
project_name = 'openpsg'
expt_name = 'vctree_panoptic_fpn_r101_fpn_1x_sgdet_psg'
work_dir = f'./work_dirs/{expt_name}'
log_config = di... | 764 | 25.37931 | 94 | py |
OpenPSG | OpenPSG-main/configs/vctree/panoptic_fpn_r50_fpn_1x_predcls_psg.py | _base_ = [
'../motifs/panoptic_fpn_r50_fpn_1x_predcls_psg.py',
]
model = dict(relation_head=dict(
type='VCTreeHead',
head_config=dict(
# NOTE: Evaluation type
use_gt_box=True,
use_gt_label=True,
),
))
evaluation = dict(interval=1,
metric='predcls',
... | 1,041 | 22.681818 | 61 | py |
OpenPSG | OpenPSG-main/configs/vctree/panoptic_fpn_r101_fpn_1x_predcls_psg.py | _base_ = './panoptic_fpn_r50_fpn_1x_predcls_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
# Log config
project_name = 'openpsg'
expt_name = 'vctree_panoptic_fpn_r101_fpn_1x_predcls_psg'
work_dir = f'./work_dirs/{expt_name}'
log_config ... | 768 | 25.517241 | 94 | py |
OpenPSG | OpenPSG-main/configs/psgtr/psgtr_r50.py | model = dict(
type='PSGTr',
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
norm_eval=True,
... | 4,523 | 53.506024 | 77 | py |
OpenPSG | OpenPSG-main/configs/psgtr/psgtr_r50_psg_inference.py | _base_ = [
'./psgtr_r50_psg.py'
]
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True)
pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(1333, 800),
flip=False,
... | 760 | 23.548387 | 53 | py |
OpenPSG | OpenPSG-main/configs/psgtr/psgtr_r101_psg.py | _base_ = [
'../_base_/models/psgtr_r101.py', '../_base_/datasets/psg.py',
'../_base_/custom_runtime.py'
]
custom_imports = dict(imports=[
'openpsg.models.frameworks.psgtr', 'openpsg.models.losses.seg_losses',
'openpsg.models.relation_heads.psgtr_head', 'openpsg.datasets',
'openpsg.datasets.pipeline... | 7,589 | 31.715517 | 98 | py |
OpenPSG | OpenPSG-main/configs/psgtr/psgtr_r50_psg.py | _base_ = [
'../_base_/models/psgtr_r50.py', '../_base_/datasets/psg.py',
'../_base_/custom_runtime.py'
]
custom_imports = dict(imports=[
'openpsg.models.frameworks.psgtr', 'openpsg.models.losses.seg_losses',
'openpsg.models.relation_heads.psgtr_head', 'openpsg.datasets',
'openpsg.datasets.pipelines... | 7,699 | 31.905983 | 98 | py |
OpenPSG | OpenPSG-main/configs/_base_/custom_runtime.py | checkpoint_config = dict(interval=1, max_keep_ckpts=1)
# yapf:disable
log_config = dict(
interval=50,
hooks=[
dict(type='TextLoggerHook'),
# dict(type='TensorboardLoggerHook')
])
# yapf:enable
custom_hooks = [dict(type='NumClassCheckHook')]
dist_params = dict(backend='nccl')
log_level = 'IN... | 399 | 21.222222 | 54 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/detr4seg_r101_psg.py | _base_ = [
'../_base_/models/detr4seg_r101.py', '../_base_/datasets/psg.py',
'../_base_/custom_runtime.py'
]
custom_imports = dict(imports=[
'openpsg.models.frameworks.detr4seg',
'openpsg.models.relation_heads.detr4seg_head', 'openpsg.datasets',
'openpsg.datasets.pipelines.loading',
'openpsg.da... | 5,776 | 40.862319 | 78 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/psgtr_r50.py | model = dict(
type='PSGTr',
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
norm_eval=True,
... | 4,523 | 53.506024 | 77 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/mask_rcnn_r50_fpn.py | # model settings
model = dict(
type='MaskRCNN',
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True... | 5,776 | 52.490741 | 77 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/detr4seg_r101.py | model = dict(
type='DETR4seg',
backbone=dict(type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
norm_eval=True,
... | 3,394 | 51.230769 | 77 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/detr4seg_r50.py | model = dict(
type='DETR4seg',
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
norm_eval=True,
... | 3,471 | 51.606061 | 77 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/detr4seg_r50_psg.py | _base_ = ['./detr4seg_r50.py', '../datasets/psg.py', '../custom_runtime.py']
custom_imports = dict(imports=[
'openpsg.models.frameworks.detr4seg',
'openpsg.models.relation_heads.detr4seg_head', 'openpsg.datasets',
'openpsg.datasets.pipelines.loading',
'openpsg.datasets.pipelines.rel_randomcrop',
'o... | 6,341 | 40.45098 | 78 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/psgtr_r101.py | _base_ = './psgtr_r50.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
| 147 | 23.666667 | 76 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/panoptic_fpn_r101_fpn_psg.py | _base_ = './panoptic_fpn_r50_fpn_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
expt_name = 'panoptic_fpn_r101_fpn_psg'
load_from = 'work_dirs/checkpoints/panoptic_fpn_r101_fpn_1x_coco_20210820_193950-ab9157a2.pth'
| 298 | 32.222222 | 94 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/panoptic_fpn_r50_fpn_psg.py | _base_ = [
'../models/mask_rcnn_r50_fpn.py',
'../datasets/psg_panoptic.py',
'../schedules/schedule_1x.py',
'../custom_runtime.py',
]
model = dict(
type='PanopticFPN',
semantic_head=dict(
type='PanopticFPNHead',
num_things_classes=80,
num_stuff_classes=53,
in_chan... | 2,114 | 27.2 | 93 | py |
OpenPSG | OpenPSG-main/configs/_base_/models/detr_r50.py | model = dict(
type='DETR',
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(3, ),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
norm_eval=True,
style='... | 3,360 | 50.707692 | 77 | py |
OpenPSG | OpenPSG-main/configs/_base_/schedules/schedule_1x.py | # optimizer
optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(policy='step',
warmup='linear',
warmup_iters=500,
warmup_ratio=0.001,
step=[8, 11])
runner =... | 366 | 32.363636 | 72 | py |
OpenPSG | OpenPSG-main/configs/_base_/schedules/schedule_3x.py | # optimizer
optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(policy='step',
warmup='linear',
warmup_iters=1000,
warmup_ratio=0.001,
step=[27, 33])
runner... | 368 | 32.545455 | 72 | py |
OpenPSG | OpenPSG-main/configs/_base_/datasets/vg_sg.py | # dataset settings
dataset_type = 'SceneGraphDataset'
ann_file = '/mnt/ssd/gzj/data/VisualGenome/data_openpsg.json'
img_dir = '/mnt/ssd/gzj/data/VisualGenome/VG_100K'
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True)
train_pipeline = [... | 2,328 | 39.155172 | 74 | py |
OpenPSG | OpenPSG-main/configs/_base_/datasets/psg.py | # dataset settings
dataset_type = 'PanopticSceneGraphDataset'
# ann_file = './data/psg/psg.json' # full data, available after PSG challenge
ann_file = './data/psg/psg.json' # './data/psg/psg_train_val.json' for PSG challenge development
# ann_file = './data/psg/psg_val_test.json' # for PSG challenge submission
coco_ro... | 2,861 | 28.8125 | 97 | py |
OpenPSG | OpenPSG-main/configs/_base_/datasets/psg_panoptic.py | # dataset settings
dataset_type = 'PanopticSceneGraphDataset'
ann_file = './data/psg/psg.json'
coco_root = './data/coco'
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(... | 2,005 | 26.479452 | 78 | py |
OpenPSG | OpenPSG-main/configs/_base_/datasets/vg_detection.py | # dataset settings
custom_imports = dict(imports=[
'openpsg.datasets',
'openpsg.datasets.pipelines',
],
allow_failed_imports=False)
dataset_type = 'SceneGraphDataset'
ann_file = 'data/vg/data_openpsg.json'
img_dir = 'data/vg/VG_100K'
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53],
... | 2,016 | 34.385965 | 65 | py |
OpenPSG | OpenPSG-main/configs/_base_/datasets/psg_val.py | # dataset settings
dataset_type = 'PanopticSceneGraphDataset'
ann_file = 'data/psg/psg.json'
coco_root = 'data/coco'
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
to_rgb=True)
test_pipeline = [
dict(type='LoadImageFromFile'),
# Since th... | 1,793 | 29.931034 | 73 | py |
OpenPSG | OpenPSG-main/configs/psgformer/psgformer_r50_psg.py | _base_ = [
'./psgformer_r50.py', '../_base_/datasets/psg.py',
'../_base_/custom_runtime.py'
]
find_unused_parameters = True
custom_imports = dict(imports=[
'openpsg.models.frameworks.psgtr', 'openpsg.models.losses.seg_losses',
'openpsg.models.frameworks.dual_transformer',
'openpsg.models.relation_... | 8,231 | 32.6 | 78 | py |
OpenPSG | OpenPSG-main/configs/psgformer/psgformer_r101_psg.py | _base_ = './psgformer_r50_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
# learning policy
lr_config = dict(policy='step', step=48)
runner = dict(type='EpochBasedRunner', max_epochs=60)
project_name = 'psgformer'
expt_name = 'psgformer_... | 488 | 27.764706 | 76 | py |
OpenPSG | OpenPSG-main/configs/psgformer/psgformer_r50.py | model = dict(
type='PSGTr',
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
norm_eval=True,
... | 5,041 | 50.979381 | 79 | py |
OpenPSG | OpenPSG-main/configs/motifs/panoptic_fpn_r50_fpn_1x_sgdet_psg.py | _base_ = [
'./panoptic_fpn_r50_fpn_1x_predcls_psg.py',
]
model = dict(
relation_head=dict(
head_config=dict(
# NOTE: Evaluation type
use_gt_box=False,
use_gt_label=False,
), ),
roi_head=dict(bbox_head=dict(type='SceneGraphBBoxHead'), ),
)
evaluation = di... | 1,038 | 22.088889 | 63 | py |
OpenPSG | OpenPSG-main/configs/motifs/panoptic_fpn_r101_fpn_1x_sgdet_psg.py | _base_ = './panoptic_fpn_r50_fpn_1x_sgdet_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
# Log config
project_name = 'openpsg'
expt_name = 'motifs_panoptic_fpn_r101_fpn_1x_sgdet_psg'
work_dir = f'./work_dirs/{expt_name}'
log_config = di... | 764 | 25.37931 | 94 | py |
OpenPSG | OpenPSG-main/configs/motifs/panoptic_fpn_r50_fpn_1x_predcls_psg.py | _base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/psg.py',
'../_base_/schedules/schedule_1x.py',
'../_base_/custom_runtime.py',
]
find_unused_parameters = True
dataset_type = 'PanopticSceneGraphDataset'
# HACK:
object_classes = [
'person', 'bicycle', 'car', 'motorcycle', 'air... | 7,468 | 29.863636 | 93 | py |
OpenPSG | OpenPSG-main/configs/motifs/panoptic_fpn_r101_fpn_1x_predcls_psg.py | _base_ = './panoptic_fpn_r50_fpn_1x_predcls_psg.py'
model = dict(backbone=dict(
depth=101,
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet101')))
# Log config
project_name = 'openpsg'
expt_name = 'motifs_panoptic_fpn_r101_fpn_1x_predcls_psg'
work_dir = f'./work_dirs/{expt_name}'
log_config ... | 768 | 25.517241 | 94 | py |
epsnoise | epsnoise-master/setup.py | from setuptools import setup
setup(name="epsnoise",
description="Simulate pixel noise for weak-lensing ellipticity measurements",
long_description="Simulate pixel noise for weak-lensing ellipticity measurements",
version="0.1",
license="MIT",
author="Peter Melchior",
author_email="p... | 467 | 30.2 | 88 | py |
epsnoise | epsnoise-master/epsnoise.py | #!/bin/env python
from numpy import cos, sin, exp, angle, real, conj
from numpy.random import normal, random, rayleigh
from math import pi, sqrt, tanh
from scipy.special import erf
from scipy.optimize import fmin
def chi2eps(chi):
"""Calculate epsilon ellipticity from chi.
Args:
chi: a real or co... | 9,017 | 33.288973 | 96 | py |
pyGPCCA | pyGPCCA-main/setup.py | from pathlib import Path
from setuptools import setup, find_packages
try:
from pygpcca import __email__, __author__, __version__, __maintainer__
except ImportError:
__author__ = __maintainer__ = "Bernhard Reuter"
__version__ = "1.0.4"
__email__ = "bernhard-reuter@gmx.de"
setup(
name="pygpcca",
... | 3,114 | 33.611111 | 110 | py |
pyGPCCA | pyGPCCA-main/pygpcca/_sort_real_schur.py | # Python version (translated by Fabian Paul; revised by Bernhard Reuter, Michal Klein) of the following original work:
# --------------------------------------------------------------------------------------------------------------------
# Title: Sorting Real Schur Forms
# Author: Jan Brandts
# E-Mail: brandts-AT-scien... | 23,920 | 37.334936 | 119 | py |
pyGPCCA | pyGPCCA-main/pygpcca/_types.py | from typing import Any, Optional
import numpy as np
__all__ = ["ArrayLike"]
try:
from numpy.typing import NDArray
ArrayLike = NDArray[Any]
except (ImportError, TypeError):
ArrayLike = np.ndarray # type: ignore[misc]
OArray = Optional[ArrayLike]
| 264 | 15.5625 | 48 | py |
pyGPCCA | pyGPCCA-main/pygpcca/__init__.py | from pygpcca.utils import stationary_distribution # type: ignore[attr-defined]
from pygpcca._gpcca import GPCCA, gpcca_coarsegrain
__author__ = __maintainer__ = "Bernhard Reuter"
__version__ = "1.0.4"
__email__ = "bernhard-reuter@gmx.de"
| 240 | 33.428571 | 79 | py |
pyGPCCA | pyGPCCA-main/pygpcca/_gpcca.py | # This file is part of pyGPCCA.
#
# Copyright (c) 2020 Bernhard Reuter.
# With contributions of Marius Lange and Michal Klein.
# Based on the original MATLAB GPCCA code authored by Bernhard Reuter, Susanna Roeblitz and Marcus Weber,
# Zuse Institute Berlin, Takustrasse 7, 14195 Berlin
# --------------------------------... | 47,636 | 35.503448 | 120 | py |
pyGPCCA | pyGPCCA-main/pygpcca/_sorted_schur.py | # This file is part of pyGPCCA.
#
# Copyright (c) 2020 Bernhard Reuter.
# With contributions of Marius Lange, Michal Klein and Alexander Sikorski.
# Based on the original MATLAB GPCCA code authored by Bernhard Reuter, Susanna Roeblitz and Marcus Weber,
# Zuse Institute Berlin, Takustrasse 7, 14195 Berlin
# We like to t... | 14,645 | 34.721951 | 122 | py |
pyGPCCA | pyGPCCA-main/pygpcca/utils/_utils.py | # This file is part of pyGPCCA.
#
# The code and documentation of the functions below origins (with some adjustments) from MSMTools.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# MSMTools is free software: you can redistribute it and/or modify
# it under the ter... | 13,967 | 31.036697 | 120 | py |
pyGPCCA | pyGPCCA-main/pygpcca/utils/_checks.py | from typing import Tuple, Union, Optional
import logging
from scipy.sparse import issparse, spmatrix
import numpy as np
from pygpcca._types import ArrayLike
from pygpcca.utils._docs import d
__all__ = ["ensure_ndarray_or_sparse", "assert_petsc_real_scalar_type"]
@d.get_sections(base="assert_array", sections=["Para... | 5,942 | 39.428571 | 118 | py |
pyGPCCA | pyGPCCA-main/pygpcca/utils/__init__.py | from pygpcca.utils._utils import stationary_distribution
| 57 | 28 | 56 | py |
pyGPCCA | pyGPCCA-main/pygpcca/utils/_docs.py | from docrep import DocstringProcessor
P = """\
P
The transition matrix (row-stochastic)."""
m = """\
m
The number of clusters to group into."""
k = """\
k
The number of eigenvalues and Schur vectors to sort."""
m_optimize = """\
m
The number of clusters or a range where a search for potentially opti... | 4,660 | 35.131783 | 109 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.