repo stringlengths 1 99 | file stringlengths 13 215 | code stringlengths 12 59.2M | file_length int64 12 59.2M | avg_line_length float64 3.82 1.48M | max_line_length int64 12 2.51M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
BertGen | BertGen-master/common/utils/multi_task_dataloader.py | from functools import reduce
import operator
from typing import List
from torch.utils.data import DataLoader
import sys
INT_MAX = sys.maxsize
def prod(iterable):
if len(list(iterable)) > 0:
return reduce(operator.mul, iterable)
else:
return 1
class MultiTaskDataLoader(object):
"""
M... | 1,619 | 26.931034 | 102 | py |
BertGen | BertGen-master/common/utils/misc.py | import os
import numpy as np
import torch
import torch.nn.functional as F
import logging
def block_digonal_matrix(*blocks):
"""
Construct block diagonal matrix
:param blocks: blocks of block diagonal matrix
:param device
:param dtype
:return: block diagonal matrix
"""
assert len(blocks... | 5,958 | 36.71519 | 124 | py |
BertGen | BertGen-master/common/utils/flatten.py | import torch
class Flattener(torch.nn.Module):
def __init__(self):
"""
Flattens last 3 dimensions to make it only batch size, -1
"""
super(Flattener, self).__init__()
def forward(self, x):
return x.view(x.size(0), -1)
| 269 | 19.769231 | 65 | py |
BertGen | BertGen-master/common/utils/bbox.py | import torch
def nonlinear_transform(ex_rois, gt_rois):
"""
compute bounding box regression targets from ex_rois to gt_rois
:param ex_rois: [k, 4] ([x1, y1, x2, y2])
:param gt_rois: [k, 4] (corresponding gt_boxes [x1, y1, x2, y2] )
:return: bbox_targets: [k, 4]
"""
assert ex_rois.shape[0] ... | 3,289 | 33.631579 | 113 | py |
BertGen | BertGen-master/common/utils/load.py | import torch
import os
def smart_load_model_state_dict(model, state_dict):
parsed_state_dict = {}
for k, v in state_dict.items():
if k not in model.state_dict():
if k.startswith('module.'):
k = k[len('module.'):]
else:
k = 'module.' + k
i... | 7,269 | 43.329268 | 153 | py |
BertGen | BertGen-master/common/utils/masked_softmax.py | import torch
def masked_softmax(vector: torch.Tensor, mask: torch.Tensor, dim: int = -1) -> torch.Tensor:
"""
``torch.nn.functional.softmax(vector)`` does not work if some elements of ``vector`` should be
masked. This performs a softmax on just the non-masked portions of ``vector``. Passing
``None``... | 1,533 | 50.133333 | 111 | py |
BertGen | BertGen-master/common/utils/pad_sequence.py | import torch
def pad_sequence(sequence, lengths):
"""
:param sequence: [\sum b, .....] sequence
:param lengths: [b1, b2, b3...] that sum to \sum b
:return: [len(lengths), maxlen(b), .....] tensor
"""
output = sequence.new_zeros(len(lengths), max(lengths), *sequence.shape[1:])
start = 0
... | 480 | 25.722222 | 80 | py |
BertGen | BertGen-master/common/utils/clip_pad.py | import torch
def clip_pad_images(tensor, pad_shape, pad=0):
"""
Clip clip_pad_images of the pad area.
:param tensor: [c, H, W]
:param pad_shape: [h, w]
:return: [c, h, w]
"""
if not isinstance(tensor, torch.Tensor):
tensor = torch.as_tensor(tensor)
H, W = tensor.shape[1:]
h... | 1,738 | 28.982759 | 93 | py |
BertGen | BertGen-master/common/utils/mask.py | from skimage.draw import polygon
import torch
def generate_instance_mask(seg_polys, box, mask_size=(14, 14), dtype=torch.float32, copy=True):
"""
Generate instance mask from polygon
:param seg_poly: torch.Tensor, (N, 2), (x, y) coordinate of N vertices of segmented foreground polygon
:param box: array... | 1,282 | 33.675676 | 106 | py |
BertGen | BertGen-master/LanguageGeneration/evaluate_translation.py | ######
# Author: Faidon Mitzalis
# Date: June 2020
# Comments: Use results of testing to evaluate performance of MT translation task
######
import json
import torch
import operator
import sacrebleu
import unidecode
import sys
model = sys.argv[1]
filepath = sys.argv[2]
lang = sys.argv[3]
with open(filepath) as json... | 1,398 | 28.765957 | 81 | py |
BertGen | BertGen-master/LanguageGeneration/train_end2end.py | import _init_paths
import os
import argparse
import torch
import subprocess
from LanguageGeneration.function.config import config, update_config
from LanguageGeneration.function.train import train_net
def parse_args():
parser = argparse.ArgumentParser('Train Cognition Network')
parser.add_argument('--cfg', t... | 1,997 | 34.678571 | 87 | py |
BertGen | BertGen-master/LanguageGeneration/function/val.py | from collections import namedtuple
import torch
from common.trainer import to_cuda
@torch.no_grad()
def do_validation(net, val_loader, metrics, label_index_in_batch):
net.eval()
metrics.reset()
for nbatch, batch in enumerate(val_loader):
batch = to_cuda(batch)
outputs, _ = net(*batch)
... | 349 | 22.333333 | 66 | py |
BertGen | BertGen-master/LanguageGeneration/function/test.py | ######
# Author: Faidon Mitzalis
# Date: June 2020
# Comments: Run model with all caption-image pairs in the dataset
######
import os
import pprint
import shutil
import json
from tqdm import tqdm, trange
import numpy as np
import torch
import torch.nn.functional as F
from common.utils.load import smart_load_model_st... | 4,571 | 40.944954 | 129 | py |
BertGen | BertGen-master/LanguageGeneration/function/vis.py | import os
import pprint
import shutil
import inspect
import random
import math
from tqdm import trange
import numpy as np
import torch
import torch.nn
import torch.distributed as distributed
from torch.nn.parallel import DistributedDataParallel as DDP
from common.utils.load import smart_partial_load_model_state_dict
... | 6,305 | 40.486842 | 119 | py |
BertGen | BertGen-master/LanguageGeneration/function/train.py | import os
import pprint
import shutil
import inspect
import random
from tensorboardX import SummaryWriter
import numpy as np
import torch
import torch.nn
import torch.optim as optim
import torch.distributed as distributed
from torch.nn.parallel import DistributedDataParallel as DDP
from common.utils.create_logger imp... | 21,500 | 50.192857 | 165 | py |
BertGen | BertGen-master/LanguageGeneration/modules/bertgen_multitask_training.py | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from external.pytorch_pretrained_bert import BertTokenizer
from common.module import Module
from common.fast_rcnn import FastRCNN
from common.visual_linguistic_bert import VisualLinguisticBertForPretraining
from common.utils.misc import soft_c... | 15,497 | 44.988131 | 139 | py |
BertGen | BertGen-master/LanguageGeneration/modules/bertgen_generate_mt.py | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from external.pytorch_pretrained_bert import BertTokenizer
from common.module import Module
from common.fast_rcnn import FastRCNN
from common.visual_linguistic_bert import VisualLinguisticBertForPretraining
from common.utils.misc import soft_c... | 12,103 | 45.733591 | 125 | py |
BertGen | BertGen-master/LanguageGeneration/modules/bertgen_generate_image_only.py | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from external.pytorch_pretrained_bert import BertTokenizer
from common.module import Module
from common.fast_rcnn import FastRCNN
from common.visual_linguistic_bert import VisualLinguisticBertForPretraining
from common.utils.misc import soft_c... | 13,238 | 45.452632 | 122 | py |
BertGen | BertGen-master/LanguageGeneration/modules/bertgen_global_generate_mmt.py | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from external.pytorch_pretrained_bert import BertTokenizer
from common.module import Module
from common.fast_rcnn import FastRCNN
from common.visual_linguistic_bert import VisualLinguisticBertForPretraining
from common.utils.misc import soft_c... | 13,172 | 45.221053 | 122 | py |
BertGen | BertGen-master/LanguageGeneration/data/collate_batch.py | import torch
from common.utils.clip_pad import *
class BatchCollator(object):
def __init__(self, dataset, append_ind=False):
self.dataset = dataset
self.test_mode = self.dataset.test_mode
self.data_names = self.dataset.data_names
self.append_ind = append_ind
def __call__(self,... | 4,167 | 42.416667 | 119 | py |
BertGen | BertGen-master/LanguageGeneration/data/build.py | import torch.utils.data
from .datasets import *
from . import samplers
from .transforms.build import build_transforms
from .collate_batch import BatchCollator
import pprint
from copy import deepcopy
# FM: Added mutli30k to available datasets
DATASET_CATALOGS = {
'multi30k': Multi30kDataset,
'multi30k_image_on... | 6,042 | 41.258741 | 111 | py |
BertGen | BertGen-master/LanguageGeneration/data/datasets/multi30k_no_vision.py | import random
import os
import time
import json
import jsonlines
from PIL import Image
import base64
import numpy as np
import logging
import torch
from torch.utils.data import Dataset
from external.pytorch_pretrained_bert import BertTokenizer
from common.utils.zipreader import ZipReader
from common.utils.create_logg... | 15,683 | 42.325967 | 106 | py |
BertGen | BertGen-master/LanguageGeneration/data/datasets/multi30k_image_only_COCO.py | import random
import os
import time
import json
import jsonlines
from PIL import Image
import base64
import numpy as np
import logging
import torch
from torch.utils.data import Dataset
from external.pytorch_pretrained_bert import BertTokenizer
from common.utils.zipreader import ZipReader
from common.utils.create_logg... | 21,270 | 42.948347 | 111 | py |
BertGen | BertGen-master/LanguageGeneration/data/datasets/multi30k_image_only_5x.py | import random
import os
import time
import json
import jsonlines
from PIL import Image
import base64
import numpy as np
import logging
import torch
from torch.utils.data import Dataset
from external.pytorch_pretrained_bert import BertTokenizer
from common.utils.zipreader import ZipReader
from common.utils.create_logg... | 17,998 | 43.115196 | 117 | py |
BertGen | BertGen-master/LanguageGeneration/data/datasets/multi30k.py | import random
import os
import time
import json
import jsonlines
from PIL import Image
import base64
import numpy as np
import logging
import torch
from torch.utils.data import Dataset
from external.pytorch_pretrained_bert import BertTokenizer
from common.utils.zipreader import ZipReader
from common.utils.create_logg... | 22,174 | 43.707661 | 111 | py |
BertGen | BertGen-master/LanguageGeneration/data/datasets/multi30k_image_only.py | import random
import os
import time
import json
import jsonlines
from PIL import Image
import base64
import numpy as np
import logging
import torch
from torch.utils.data import Dataset
from external.pytorch_pretrained_bert import BertTokenizer
from common.utils.zipreader import ZipReader
from common.utils.create_logg... | 21,632 | 42.969512 | 111 | py |
BertGen | BertGen-master/LanguageGeneration/data/samplers/grouped_batch_sampler.py | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import itertools
import torch
from torch.utils.data.sampler import BatchSampler
from torch.utils.data.sampler import Sampler
class GroupedBatchSampler(BatchSampler):
"""
Wraps another sampler to yield a mini-batch of indices.
It enfo... | 4,846 | 40.42735 | 88 | py |
BertGen | BertGen-master/LanguageGeneration/data/samplers/distributed.py | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Code is copy-pasted exactly as in torch.utils.data.distributed.
# FIXME remove this once c10d fixes the bug it has
import math
import torch
import torch.distributed as dist
from torch.utils.data.sampler import Sampler
class DistributedSampler(S... | 2,568 | 37.924242 | 86 | py |
BertGen | BertGen-master/LanguageGeneration/data/transforms/transforms.py | import random
import numpy as np
import torch
import torchvision
from torchvision.transforms import functional as F
class Compose(object):
def __init__(self, transforms):
self.transforms = transforms
def __call__(self, image, boxes, masks, im_info):
for t in self.transforms:
ima... | 3,944 | 29.820313 | 88 | py |
BertGen | BertGen-master/scripts/launch.py | r"""
`torch.distributed.launch` is a module that spawns up multiple distributed
training processes on each of the training nodes.
The utility can be used for single-node distributed training, in which one or
more processes per node will be spawned. The utility can be used for either
CPU training or GPU training. If the... | 9,500 | 46.268657 | 95 | py |
paperdata | paperdata-master/test_nn.py | import numpy as np
from sklearn.model_selection import train_test_split
from tensorflow.keras.layers import BatchNormalization, Dense, Dropout
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import SGD
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEV... | 1,170 | 27.560976 | 81 | py |
SparkNet | SparkNet-master/scripts/put_imagenet_on_s3.py | # Script to upload the imagenet dataset to Amazon S3 or another remote file
# system (have to change the function upload_file to support more storage
# systems).
import boto3
import urllib
import tarfile, io
import argparse
import random
import PIL.Image
import collections
parser = argparse.ArgumentParser()
parser.a... | 5,062 | 42.273504 | 110 | py |
neat-ml | neat-ml-main/neat_ml/link_prediction/mlp_model.py | """MLP model."""
import os
import pickle
from warnings import warn
try:
import tensorflow as tf # type: ignore
HAVE_TF = True
except ModuleNotFoundError:
print("Tensorflow not found. MLP model compilation may fail!")
HAVE_TF = False
from .model import Model
class MLPModel(Model):
"""MLP model ... | 4,566 | 33.338346 | 79 | py |
neat-ml | neat-ml-main/tests/test_link_prediction.py | """Test link prediction."""
import os
import pathlib
from unittest import TestCase
import numpy as np
import pandas as pd
from grape import Graph
try:
from keras.engine.sequential import Sequential
HAVE_KERAS = True
except ModuleNotFoundError:
print("Keras not found - will not test related functions.")
... | 5,797 | 34.570552 | 123 | py |
neat-ml | neat-ml-main/input_data/analyze_GO_pos_neg_edges.py | from ensmallen import Graph # type: ignore
from embiggen import GraphTransformer # type: ignore
import numpy as np
import pandas as pd
import yaml
import os
import tensorflow as tf
go_yaml_file = "go.yaml"
os.chdir("..") # paths to files are from root dir
with open(go_yaml_file, 'r') as stream:
go_yaml = yaml.lo... | 3,854 | 38.336735 | 116 | py |
simulacra-aesthetic-models | simulacra-aesthetic-models-master/simulacra_compute_embeddings.py | #!/usr/bin/env python3
"""Precomputes CLIP embeddings for Simulacra Aesthetic Captions."""
import argparse
import os
from pathlib import Path
import sqlite3
from PIL import Image
import torch
from torch import multiprocessing as mp
from torch.utils import data
import torchvision.transforms as transforms
from tqdm i... | 3,327 | 33.309278 | 256 | py |
simulacra-aesthetic-models | simulacra-aesthetic-models-master/rank_images.py | import os
from argparse import ArgumentParser
from tqdm import tqdm
from PIL import Image
from torch.nn import functional as F
from torchvision import transforms
from torchvision.transforms import functional as TF
import torch
from simulacra_fit_linear_model import AestheticMeanPredictionLinearModel
from CLIP import cl... | 2,334 | 32.357143 | 75 | py |
simulacra-aesthetic-models | simulacra-aesthetic-models-master/simulacra_fit_linear_model.py | #!/usr/bin/env python3
"""Fits a linear aesthetic model to precomputed CLIP embeddings."""
import argparse
import numpy as np
from sklearn.linear_model import Ridge
from sklearn.model_selection import train_test_split
import torch
from torch import nn
from torch.nn import functional as F
class AestheticMeanPredict... | 1,834 | 33.622642 | 108 | py |
oilmm | oilmm-master/docs/conf.py | # -*- coding: utf-8 -*-
#
# oilmm documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a... | 5,270 | 30.562874 | 79 | py |
oilmm | oilmm-master/experiments/temperature_igp.py | import lab.torch as B
import numpy as np
import torch
import wbml.plot
from stheno import Matern52
from varz import Vars
from varz.torch import minimise_l_bfgs_b
from wbml.data.cmip5 import load
from wbml.experiment import WorkingDirectory
from oilmm import IGP, Normaliser
if __name__ == "__main__":
B.epsilon = ... | 2,601 | 27.911111 | 86 | py |
oilmm | oilmm-master/experiments/timing.py | import time
import lab.torch as B
import numpy as np
import torch
import wbml.plot
from matrix import Dense, Diagonal
from oilmm import OILMM
from stheno import Matern52
from varz import Vars
from wbml.data.cmip5 import load
from wbml.experiment import WorkingDirectory
if __name__ == "__main__":
B.epsilon = 1e-8
... | 2,722 | 32.207317 | 86 | py |
oilmm | oilmm-master/experiments/simulators.py | import argparse
import lab.torch as B
import numpy as np
import torch
import wbml.plot
from matrix import Dense, Diagonal, Kronecker
from oilmm import OILMM, Normaliser
from stheno.torch import Matern52 as Mat52
from varz import Vars
from varz.torch import minimise_l_bfgs_b
from wbml.data.cmip5 import load
from wbml.e... | 5,569 | 31.011494 | 88 | py |
oilmm | oilmm-master/experiments/temperature.py | import argparse
import lab.torch as B
import numpy as np
import torch
import wbml.plot
from matrix import Dense, Diagonal
from oilmm import OILMM, Normaliser
from stheno import Matern52
from varz import Vars
from varz.torch import minimise_l_bfgs_b
from wbml.data.cmip5 import load
from wbml.experiment import WorkingDi... | 3,302 | 29.869159 | 86 | py |
oilmm | oilmm-master/oilmm/jax.py | # noinspection PyUnresolvedReferences
import stheno.jax
# noinspection PyUnresolvedReferences
from . import *
| 111 | 17.666667 | 37 | py |
oilmm | oilmm-master/oilmm/torch.py | # noinspection PyUnresolvedReferences
import stheno.torch
# noinspection PyUnresolvedReferences
from . import *
| 113 | 18 | 37 | py |
stellargraph | stellargraph-master/stellargraph/losses.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 4,094 | 36.916667 | 209 | py |
stellargraph | stellargraph-master/stellargraph/calibration.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 20,128 | 41.918977 | 135 | py |
stellargraph | stellargraph-master/stellargraph/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 4,691 | 29.868421 | 98 | py |
stellargraph | stellargraph-master/stellargraph/ensemble.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 33,345 | 44.184282 | 162 | py |
stellargraph | stellargraph-master/stellargraph/mapper/sliding.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 8,487 | 39.807692 | 343 | py |
stellargraph | stellargraph-master/stellargraph/mapper/graphwave_generator.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 9,979 | 39.734694 | 179 | py |
stellargraph | stellargraph-master/stellargraph/mapper/knowledge_graph.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 8,924 | 36.5 | 208 | py |
stellargraph | stellargraph-master/stellargraph/mapper/adjacency_generators.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 5,798 | 34.359756 | 174 | py |
stellargraph | stellargraph-master/stellargraph/mapper/sampled_node_generators.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 28,026 | 35.926219 | 201 | py |
stellargraph | stellargraph-master/stellargraph/mapper/padded_graph_generator.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 13,859 | 39.645161 | 160 | py |
stellargraph | stellargraph-master/stellargraph/mapper/corrupted.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 8,936 | 45.546875 | 269 | py |
stellargraph | stellargraph-master/stellargraph/mapper/mini_batch_node_generators.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 15,819 | 38.255583 | 173 | py |
stellargraph | stellargraph-master/stellargraph/mapper/full_batch_generators.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 21,497 | 39.562264 | 197 | py |
stellargraph | stellargraph-master/stellargraph/mapper/sequences.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 20,050 | 36.548689 | 107 | py |
stellargraph | stellargraph-master/stellargraph/mapper/sampled_link_generators.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 28,318 | 37.012081 | 202 | py |
stellargraph | stellargraph-master/stellargraph/interpretability/saliency_maps/integrated_gradients.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 9,865 | 40.628692 | 140 | py |
stellargraph | stellargraph-master/stellargraph/interpretability/saliency_maps/saliency_gat.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 9,216 | 43.960976 | 185 | py |
stellargraph | stellargraph-master/stellargraph/interpretability/saliency_maps/integrated_gradients_gat.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 6,306 | 45.036496 | 181 | py |
stellargraph | stellargraph-master/stellargraph/utils/history.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 3,633 | 35.707071 | 117 | py |
stellargraph | stellargraph-master/stellargraph/data/explorer.py | # -*- coding: utf-8 -*-
#
# Copyright 2017-2020 Data61, CSIRO
#
# 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 ... | 50,782 | 41.603188 | 468 | py |
stellargraph | stellargraph-master/stellargraph/data/unsupervised_sampler.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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
#
# Unles... | 9,902 | 41.87013 | 410 | py |
stellargraph | stellargraph-master/stellargraph/layer/gcn_lstm.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 16,243 | 38.523114 | 196 | py |
stellargraph | stellargraph-master/stellargraph/layer/hinsage.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 24,550 | 38.726537 | 173 | py |
stellargraph | stellargraph-master/stellargraph/layer/graphsage.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 52,721 | 39.123288 | 307 | py |
stellargraph | stellargraph-master/stellargraph/layer/knowledge_graph.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 36,707 | 35.671329 | 229 | py |
stellargraph | stellargraph-master/stellargraph/layer/sort_pooling.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 ... | 4,421 | 32.5 | 117 | py |
stellargraph | stellargraph-master/stellargraph/layer/node2vec.py | # -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 applicabl... | 8,653 | 38.158371 | 593 | py |
stellargraph | stellargraph-master/stellargraph/layer/rgcn.py | # -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 applicabl... | 23,809 | 39.424448 | 173 | py |
stellargraph | stellargraph-master/stellargraph/layer/deep_graph_infomax.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 7,877 | 34.972603 | 193 | py |
stellargraph | stellargraph-master/stellargraph/layer/misc.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 4,945 | 31.539474 | 97 | py |
stellargraph | stellargraph-master/stellargraph/layer/graph_classification.py | # -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 applicabl... | 14,568 | 42.489552 | 169 | py |
stellargraph | stellargraph-master/stellargraph/layer/graph_attention.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 41,810 | 42.781152 | 202 | py |
stellargraph | stellargraph-master/stellargraph/layer/gcn.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 21,242 | 40.982213 | 269 | py |
stellargraph | stellargraph-master/stellargraph/layer/link_inference.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 17,566 | 43.138191 | 407 | py |
stellargraph | stellargraph-master/stellargraph/layer/cluster_gcn.py | # -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 applicabl... | 2,770 | 32.792683 | 141 | py |
stellargraph | stellargraph-master/stellargraph/layer/preprocessing_layer.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 4,424 | 35.270492 | 112 | py |
stellargraph | stellargraph-master/stellargraph/layer/watch_your_step.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 9,442 | 38.676471 | 175 | py |
stellargraph | stellargraph-master/stellargraph/layer/attri2vec.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 9,722 | 36.832685 | 167 | py |
stellargraph | stellargraph-master/stellargraph/layer/appnp.py | # -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 applicabl... | 16,999 | 36.037037 | 160 | py |
stellargraph | stellargraph-master/stellargraph/layer/ppnp.py | # -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 applicabl... | 13,177 | 34.712737 | 155 | py |
stellargraph | stellargraph-master/scripts/demo_indexing.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 22,242 | 29.469863 | 221 | py |
stellargraph | stellargraph-master/tests/test_ensemble.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 ... | 28,207 | 32.822542 | 112 | py |
stellargraph | stellargraph-master/tests/interpretability/test_saliency_maps_gat.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 ... | 4,669 | 35.484375 | 155 | py |
stellargraph | stellargraph-master/tests/interpretability/test_saliency_maps_gcn.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 ... | 5,711 | 33.618182 | 128 | py |
stellargraph | stellargraph-master/tests/test_utils/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 2,432 | 31.013158 | 101 | py |
stellargraph | stellargraph-master/tests/reproducibility/test_deep_graph_infomax.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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 o... | 1,937 | 31.847458 | 81 | py |
stellargraph | stellargraph-master/tests/reproducibility/test_graphsage.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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 o... | 7,036 | 26.488281 | 93 | py |
stellargraph | stellargraph-master/tests/reproducibility/fixtures.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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 o... | 1,356 | 29.155556 | 88 | py |
stellargraph | stellargraph-master/tests/layer/test_graph_classification.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 7,433 | 31.181818 | 99 | py |
stellargraph | stellargraph-master/tests/layer/test_ppnp.py | # -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 applicabl... | 2,904 | 32.390805 | 88 | py |
stellargraph | stellargraph-master/tests/layer/test_deep_graph_infomax.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 6,120 | 34.178161 | 86 | py |
stellargraph | stellargraph-master/tests/layer/test_misc.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 7,161 | 30.973214 | 85 | py |
stellargraph | stellargraph-master/tests/layer/test_gcn_lstm.py | # -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 applicabl... | 7,206 | 31.031111 | 100 | py |
stellargraph | stellargraph-master/tests/layer/test_hinsage.py | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 17,737 | 26.122324 | 116 | py |
stellargraph | stellargraph-master/tests/layer/test_watch_your_step.py | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 3,948 | 33.33913 | 98 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.