repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
lale | lale-master/lale/lib/sklearn/nystroem.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 7,989 | 35.990741 | 152 | py |
lale | lale-master/lale/lib/sklearn/variance_threshold.py | # Copyright 2021 IBM Corporation
#
# 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 in writing, ... | 3,229 | 40.410256 | 252 | py |
lale | lale-master/lale/lib/sklearn/dummy_classifier.py | # Copyright 2019-2023 IBM Corporation
#
# 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 in writ... | 6,595 | 36.908046 | 170 | py |
lale | lale-master/lale/lib/sklearn/select_k_best.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 4,757 | 32.985714 | 153 | py |
lale | lale-master/lale/lib/sklearn/random_forest_regressor.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 18,049 | 41.074592 | 215 | py |
lale | lale-master/lale/lib/sklearn/stacking_classifier.py | # Copyright 2021 IBM Corporation
#
# 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 in writing, ... | 9,498 | 34.44403 | 340 | py |
lale | lale-master/lale/lib/sklearn/isolation_forest.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 10,932 | 38.756364 | 185 | py |
lale | lale-master/lale/lib/sklearn/isomap.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 7,519 | 39 | 151 | py |
lale | lale-master/lale/lib/sklearn/missing_indicator.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 5,004 | 34 | 118 | py |
lale | lale-master/lale/lib/sklearn/normalizer.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 3,552 | 31.898148 | 106 | py |
lale | lale-master/lale/lib/sklearn/quantile_transformer.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 5,355 | 38.382353 | 124 | py |
lale | lale-master/lale/lib/sklearn/_common_schemas.py | # Copyright 2021 IBM Corporation
#
# 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 in writing, ... | 1,864 | 28.140625 | 74 | py |
lale | lale-master/lale/lib/sklearn/decision_tree_regressor.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 14,298 | 39.278873 | 211 | py |
lale | lale-master/lale/lib/sklearn/fit_spec_proxy.py | # Copyright 2022 IBM Corporation
#
# 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 in writing, ... | 1,206 | 35.575758 | 78 | py |
lale | lale-master/lale/lib/sklearn/multi_output_regressor.py | # Copyright 2021 IBM Corporation
#
# 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 in writing, ... | 4,307 | 30.676471 | 157 | py |
lale | lale-master/lale/lib/sklearn/mlp_classifier.py | # Copyright 2019-2022 IBM Corporation
#
# 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 in writ... | 13,330 | 38.093842 | 121 | py |
lale | lale-master/lale/lib/sklearn/sgd_regressor.py | # Copyright 2019-2022 IBM Corporation
#
# 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 in writ... | 14,617 | 38.939891 | 155 | py |
lale | lale-master/lale/lib/sklearn/bagging_regressor.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 13,158 | 37.364431 | 269 | py |
lale | lale-master/lale/lib/sklearn/simple_imputer.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 7,426 | 36.135 | 269 | py |
lale | lale-master/lale/lib/sklearn/stacking_regressor.py | # Copyright 2021 IBM Corporation
#
# 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 in writing, ... | 8,250 | 33.236515 | 269 | py |
lale | lale-master/lale/lib/sklearn/rfe.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 6,985 | 36.55914 | 273 | py |
lale | lale-master/lale/lib/sklearn/voting_regressor.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 9,764 | 32.441781 | 269 | py |
lale | lale-master/lale/lib/sklearn/quadratic_discriminant_analysis.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 6,392 | 33.005319 | 153 | py |
lale | lale-master/lale/lib/sklearn/random_forest_classifier.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 18,434 | 40.897727 | 215 | py |
lale | lale-master/lale/lib/sklearn/extra_trees_regressor.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 15,551 | 39.186047 | 215 | py |
lale | lale-master/lale/lib/sklearn/linear_svc.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 11,205 | 36.229236 | 120 | py |
lale | lale-master/lale/lib/sklearn/bagging_classifier.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 13,719 | 36.384196 | 185 | py |
lale | lale-master/lale/lib/sklearn/standard_scaler.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 4,292 | 33.620968 | 216 | py |
lale | lale-master/lale/lib/sklearn/ada_boost_regressor.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 8,531 | 34.40249 | 140 | py |
lale | lale-master/lale/lib/sklearn/passive_aggressive_classifier.py | # Copyright 2019-2022 IBM Corporation
#
# 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 in writ... | 10,495 | 38.458647 | 139 | py |
lale | lale-master/lale/lib/sklearn/function_transformer.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 7,319 | 40.355932 | 537 | py |
lale | lale-master/lale/lib/sklearn/nmf.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 10,579 | 35.608997 | 136 | py |
lale | lale-master/lale/lib/sklearn/svc.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 12,817 | 35.727794 | 278 | py |
lale | lale-master/lale/lib/sklearn/voting_classifier.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 10,652 | 33.587662 | 146 | py |
lale | lale-master/lale/lib/sklearn/one_hot_encoder.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 11,964 | 39.559322 | 656 | py |
lale | lale-master/lale/lib/sklearn/polynomial_features.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 4,611 | 34.751938 | 207 | py |
lale | lale-master/lale/lib/sklearn/gaussian_nb.py | # Copyright 2019-2022 IBM Corporation
#
# 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 in writ... | 3,915 | 31.363636 | 139 | py |
lale | lale-master/lale/lib/sklearn/linear_svr.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 8,352 | 39.746341 | 159 | py |
lale | lale-master/lale/lib/sklearn/linear_regression.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 6,941 | 36.934426 | 153 | py |
lale | lale-master/lale/lib/sklearn/pca.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 10,075 | 37.166667 | 252 | py |
lale | lale-master/lale/lib/sklearn/ridge_classifier.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 10,555 | 34.069767 | 115 | py |
lale | lale-master/lale/lib/sklearn/k_neighbors_regressor.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 7,004 | 35.108247 | 129 | py |
lale | lale-master/lale/lib/sklearn/stacking_utils.py | import pandas as pd
def _concatenate_predictions_pandas(base_stacking, X, predictions):
X_meta = []
idx = 0
for est_idx, preds in enumerate(predictions):
# case where the the estimator returned a 1D array
if preds.ndim == 1:
if isinstance(preds, pd.Series):
X_me... | 1,347 | 33.564103 | 82 | py |
lale | lale-master/lale/lib/sklearn/logistic_regression.py | # Copyright 2019-2023 IBM Corporation
#
# 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 in writ... | 22,154 | 39.063291 | 399 | py |
lale | lale-master/lale/lib/sklearn/__init__.py | # Copyright 2019-2022 IBM Corporation
#
# 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 in writ... | 11,336 | 45.463115 | 103 | py |
lale | lale-master/lale/lib/sklearn/dummy_regressor.py | # Copyright 2019-2023 IBM Corporation
#
# 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 in writ... | 5,742 | 35.814103 | 186 | py |
lale | lale-master/lale/lib/sklearn/ordinal_encoder.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 13,585 | 41.06192 | 176 | py |
lale | lale-master/lale/lib/sklearn/feature_agglomeration.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 11,658 | 37.478548 | 223 | py |
lale | lale-master/lale/lib/sklearn/svr.py | # Copyright 2020 IBM Corporation
#
# 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 in writing, ... | 8,508 | 34.902954 | 240 | py |
lale | lale-master/lale/lib/sklearn/ada_boost_classifier.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 10,843 | 33.75641 | 140 | py |
lale | lale-master/lale/lib/sklearn/gradient_boosting_classifier.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 21,138 | 41.533199 | 304 | py |
lale | lale-master/lale/lib/sklearn/perceptron.py | # Copyright 2022 IBM Corporation
#
# 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 in writing, ... | 9,836 | 36.545802 | 166 | py |
lale | lale-master/lale/lib/sklearn/gradient_boosting_regressor.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 18,239 | 41.716628 | 247 | py |
lale | lale-master/lale/lib/sklearn/pipeline.py | # Copyright 2020 IBM Corporation
#
# 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 in writing, ... | 7,899 | 33.497817 | 192 | py |
lale | lale-master/lale/lib/sklearn/min_max_scaler.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 4,991 | 33.427586 | 112 | py |
lale | lale-master/lale/lib/sklearn/robust_scaler.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 5,645 | 36.390728 | 303 | py |
lale | lale-master/docs/conf.py | # Copyright 2019 IBM Corporation
#
# 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 in writing, ... | 7,789 | 30.538462 | 108 | py |
PoolNet | PoolNet-master/main.py | import argparse
import os
from dataset.dataset import get_loader
from solver import Solver
def get_test_info(sal_mode='e'):
if sal_mode == 'e':
image_root = './data/ECSSD/Imgs/'
image_source = './data/ECSSD/test.lst'
elif sal_mode == 'p':
image_root = './data/PASCALS/Imgs/'
imag... | 3,827 | 38.061224 | 95 | py |
PoolNet | PoolNet-master/joint_main.py | import argparse
import os
from dataset.joint_dataset import get_loader
from joint_solver import Solver
def get_test_info(sal_mode='e'):
if sal_mode == 'e':
image_root = './data/ECSSD/Imgs/'
image_source = './data/ECSSD/test.lst'
elif sal_mode == 'p':
image_root = './data/PASCALS/Imgs/'
... | 4,316 | 40.912621 | 95 | py |
PoolNet | PoolNet-master/solver.py | import torch
from collections import OrderedDict
from torch.nn import utils, functional as F
from torch.optim import Adam
from torch.autograd import Variable
from torch.backends import cudnn
from networks.poolnet import build_model, weights_init
import scipy.misc as sm
import numpy as np
import os
import torchvision.ut... | 5,765 | 38.493151 | 129 | py |
PoolNet | PoolNet-master/joint_solver.py | import torch
from collections import OrderedDict
from torch.nn import utils, functional as F
from torch.optim import Adam
from torch.autograd import Variable
from torch.backends import cudnn
from networks.joint_poolnet import build_model, weights_init
import scipy.misc as sm
import numpy as np
import os
import torchvis... | 8,569 | 44.105263 | 163 | py |
PoolNet | PoolNet-master/networks/joint_poolnet.py | import torch
from torch import nn
from torch.nn import init
import torch.nn.functional as F
import math
from torch.autograd import Variable
import numpy as np
from .deeplab_resnet import resnet50_locate
from .vgg import vgg16_locate
config_vgg = {'convert': [[128,256,512,512,512],[64,128,256,512,512]], 'deep_pool': ... | 8,853 | 41.772947 | 344 | py |
PoolNet | PoolNet-master/networks/vgg.py | import torch.nn as nn
import math
import torch
import numpy as np
import torch.nn.functional as F
# vgg16
def vgg(cfg, i, batch_norm=False):
layers = []
in_channels = i
stage = 1
for v in cfg:
if v == 'M':
stage += 1
if stage == 6:
layers += [nn.MaxPool2d... | 3,581 | 35.927835 | 148 | py |
PoolNet | PoolNet-master/networks/poolnet.py | import torch
from torch import nn
from torch.nn import init
import torch.nn.functional as F
import math
from torch.autograd import Variable
import numpy as np
from .deeplab_resnet import resnet50_locate
from .vgg import vgg16_locate
config_vgg = {'convert': [[128,256,512,512,512],[64,128,256,512,512]], 'deep_pool': ... | 4,800 | 37.103175 | 227 | py |
PoolNet | PoolNet-master/networks/deeplab_resnet.py | import torch.nn as nn
import math
import torch
import numpy as np
import torch.nn.functional as F
affine_par = True
def conv3x3(in_planes, out_planes, stride=1):
"3x3 convolution with padding"
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
cla... | 7,161 | 34.107843 | 148 | py |
PoolNet | PoolNet-master/networks/__init__.py | 0 | 0 | 0 | py | |
PoolNet | PoolNet-master/dataset/dataset.py | import os
from PIL import Image
import cv2
import torch
from torch.utils import data
from torchvision import transforms
from torchvision.transforms import functional as F
import numbers
import numpy as np
import random
class ImageDataTrain(data.Dataset):
def __init__(self, data_root, data_list):
self.sal_r... | 3,469 | 32.047619 | 148 | py |
PoolNet | PoolNet-master/dataset/joint_dataset.py | import os
from PIL import Image
import cv2
import torch
from torch.utils import data
from torchvision import transforms
from torchvision.transforms import functional as F
import numbers
import numpy as np
import random
class ImageDataTrain(data.Dataset):
def __init__(self, sal_data_root, sal_data_list, edge_data_r... | 4,702 | 34.360902 | 148 | py |
PoolNet | PoolNet-master/dataset/__init__.py | 0 | 0 | 0 | py | |
GNNDelete | GNNDelete-main/train_node.py | import os
import wandb
import pickle
import torch
from torch_geometric.seed import seed_everything
from torch_geometric.utils import to_undirected, is_undirected
import torch_geometric.transforms as T
from torch_geometric.datasets import CitationFull, Coauthor, Flickr, RelLinkPredDataset, WordNet18, WordNet18RR
from to... | 1,881 | 30.898305 | 129 | py |
GNNDelete | GNNDelete-main/graph_stat.py | import os
from torch_geometric.data import Data
import torch_geometric.transforms as T
from torch_geometric.datasets import CitationFull, Coauthor, Flickr, RelLinkPredDataset, WordNet18RR
from ogb.linkproppred import PygLinkPropPredDataset
data_dir = './data'
datasets = ['Cora', 'PubMed', 'DBLP', 'CS', 'Physics', 'og... | 1,292 | 35.942857 | 150 | py |
GNNDelete | GNNDelete-main/delete_node_feature.py | import os
import copy
import json
import wandb
import pickle
import argparse
import torch
import torch.nn as nn
from torch_geometric.utils import to_undirected, to_networkx, k_hop_subgraph, is_undirected
from torch_geometric.data import Data
import torch_geometric.transforms as T
from torch_geometric.datasets import Ci... | 11,564 | 40.902174 | 156 | py |
GNNDelete | GNNDelete-main/delete_gnn.py | import os
import copy
import json
import wandb
import pickle
import argparse
import torch
import torch.nn as nn
from torch_geometric.utils import to_undirected, to_networkx, k_hop_subgraph, is_undirected
from torch_geometric.data import Data
from torch_geometric.loader import GraphSAINTRandomWalkSampler
from torch_geom... | 11,069 | 37.4375 | 147 | py |
GNNDelete | GNNDelete-main/train_gnn.py | import os
import wandb
import pickle
import torch
from torch_geometric.seed import seed_everything
from torch_geometric.utils import to_undirected, is_undirected
from torch_geometric.datasets import RelLinkPredDataset, WordNet18
from torch_geometric.seed import seed_everything
from framework import get_model, get_trai... | 2,977 | 34.035294 | 129 | py |
GNNDelete | GNNDelete-main/prepare_dataset.py | import os
import math
import pickle
import torch
import pandas as pd
import networkx as nx
from tqdm import tqdm
from torch_geometric.seed import seed_everything
import torch_geometric.transforms as T
from torch_geometric.data import Data
from torch_geometric.datasets import CitationFull, Coauthor, Flickr, RelLinkPredD... | 16,717 | 39.97549 | 134 | py |
GNNDelete | GNNDelete-main/delete_node.py | import os
import copy
import json
import wandb
import pickle
import argparse
import torch
import torch.nn as nn
from torch_geometric.utils import to_undirected, to_networkx, k_hop_subgraph, is_undirected
from torch_geometric.data import Data
import torch_geometric.transforms as T
from torch_geometric.datasets import Ci... | 11,453 | 40.80292 | 156 | py |
GNNDelete | GNNDelete-main/framework/data_loader.py | import os
import torch
from torch_geometric.data import Data, GraphSAINTRandomWalkSampler
def load_dict(filename):
'''Load entity and relation to id mapping'''
mapping = {}
with open(filename, 'r') as f:
for l in f:
l = l.strip().split('\t')
mapping[l[0]] = l[1]
retur... | 3,344 | 32.45 | 125 | py |
GNNDelete | GNNDelete-main/framework/utils.py | import numpy as np
import torch
import networkx as nx
def get_node_edge(graph):
degree_sorted_ascend = sorted(graph.degree, key=lambda x: x[1])
return degree_sorted_ascend[-1][0]
def h_hop_neighbor(G, node, h):
path_lengths = nx.single_source_dijkstra_path_length(G, node)
return [node for node, leng... | 1,852 | 30.40678 | 81 | py |
GNNDelete | GNNDelete-main/framework/training_args.py | import argparse
num_edge_type_mapping = {
'FB15k-237': 237,
'WordNet18': 18,
'WordNet18RR': 11,
'ogbl-biokg': 51
}
def parse_args():
parser = argparse.ArgumentParser()
# Model
parser.add_argument('--unlearning_model', type=str, default='retrain',
help='unlearn... | 6,397 | 38.9875 | 114 | py |
GNNDelete | GNNDelete-main/framework/load_data.py | import boto3
import awswrangler as wr
import pandas as pd
from .s3io import read_txt_s3, scipy_loadmat_s3
def get_binding_data_union(stage='development', boto3_session=None, gene_id_mapping_dict=None, food_chem=None):
if stage == 'default':
col = ['chemical', 'ncbi']
cg = wr.s3.read_csv(
... | 24,340 | 33.673789 | 132 | py |
GNNDelete | GNNDelete-main/framework/__init__.py | from .models import GCN, GAT, GIN, RGCN, RGAT, GCNDelete, GATDelete, GINDelete, RGCNDelete, RGATDelete
from .trainer.base import Trainer, KGTrainer, NodeClassificationTrainer
from .trainer.retrain import RetrainTrainer, KGRetrainTrainer
from .trainer.gnndelete import GNNDeleteTrainer
from .trainer.gnndelete_nodeemb imp... | 2,683 | 38.470588 | 132 | py |
GNNDelete | GNNDelete-main/framework/evaluation.py | import torch
import torch.nn.functional as F
from sklearn.metrics import roc_auc_score, average_precision_score
from .utils import get_link_labels
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
@torch.no_grad()
def eval_lp(model, stage, data=None, loader=None):
model.eval()
# For ... | 6,151 | 32.254054 | 108 | py |
GNNDelete | GNNDelete-main/framework/trainer/base.py | import os
import time
import json
import wandb
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from tqdm import trange, tqdm
from ogb.graphproppred import Evaluator
from torch_geometric.data import DataLoader
from torch_geometric.utils import negative_sampling
from torch_geometric.... | 41,518 | 41.366327 | 169 | py |
GNNDelete | GNNDelete-main/framework/trainer/member_infer.py | import os
import json
import wandb
import numpy as np
import torch
import torch.nn as nn
from tqdm import trange, tqdm
from torch_geometric.utils import negative_sampling
from sklearn.metrics import accuracy_score, roc_auc_score, average_precision_score, f1_score
from .base import Trainer
from ..evaluation import *
fr... | 8,132 | 37.728571 | 171 | py |
GNNDelete | GNNDelete-main/framework/trainer/gradient_ascent_with_mp.py | import os
import json
from tqdm import tqdm, trange
import torch
import torch.nn.functional as F
from torch_geometric.utils import negative_sampling
from .base import Trainer
from ..evaluation import *
from ..utils import *
class GradientAscentWithMessagePassingTrainer(Trainer):
def __init__(self,):
self... | 3,937 | 36.865385 | 118 | py |
GNNDelete | GNNDelete-main/framework/trainer/retrain.py | import os
import time
import wandb
from tqdm import tqdm, trange
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.utils import negative_sampling
from torch_geometric.loader import GraphSAINTRandomWalkSampler
from .base import Trainer, KGTrainer
from ..evaluatio... | 14,611 | 41.976471 | 127 | py |
GNNDelete | GNNDelete-main/framework/trainer/gnndelete_nodeemb.py | import os
import copy
import time
import wandb
from tqdm import tqdm, trange
import torch
import torch.nn as nn
from torch_geometric.utils import negative_sampling, k_hop_subgraph
from torch_geometric.loader import GraphSAINTRandomWalkSampler
from .base import Trainer, KGTrainer, NodeClassificationTrainer
from ..evalu... | 37,356 | 43.105077 | 159 | py |
GNNDelete | GNNDelete-main/framework/trainer/gnndelete.py | import os
import time
import wandb
from tqdm import tqdm, trange
import torch
import torch.nn as nn
from torch_geometric.utils import negative_sampling, k_hop_subgraph
from torch_geometric.loader import GraphSAINTRandomWalkSampler
from .base import Trainer
from ..evaluation import *
from ..utils import *
def Bounded... | 19,850 | 43.015521 | 154 | py |
GNNDelete | GNNDelete-main/framework/trainer/gradient_ascent.py | import os
import time
import wandb
from tqdm import tqdm, trange
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.utils import negative_sampling
from torch_geometric.loader import GraphSAINTRandomWalkSampler
from .base import Trainer, KGTrainer
from ..evaluation import *
from ..u... | 13,223 | 42.074919 | 128 | py |
GNNDelete | GNNDelete-main/framework/trainer/graph_eraser.py | import os
import json
import copy
import math
from tqdm import tqdm, trange
import numpy as np
import torch
import torch.nn.functional as F
from torch_geometric.utils import negative_sampling, subgraph
from .base import Trainer
from ..evaluation import *
from ..utils import *
class ConstrainedKmeans:
'''This cod... | 14,714 | 38.24 | 120 | py |
GNNDelete | GNNDelete-main/framework/trainer/descent_to_delete.py | import os
import time
import wandb
from tqdm import tqdm, trange
import torch
import torch.nn.functional as F
from torch_geometric.utils import negative_sampling
from .base import Trainer
from ..evaluation import *
from ..utils import *
class DtdTrainer(Trainer):
'''This code is adapte from https://github.com/Ch... | 4,135 | 38.390476 | 153 | py |
GNNDelete | GNNDelete-main/framework/trainer/approx_retrain.py | import os
import wandb
from tqdm import tqdm, trange
import torch
import torch.nn.functional as F
from torch_geometric.utils import negative_sampling
from torch.utils.data import DataLoader, TensorDataset
from .base import Trainer
from ..evaluation import *
from ..utils import *
DTYPE = np.float16
class ApproxTrain... | 5,736 | 33.14881 | 117 | py |
GNNDelete | GNNDelete-main/framework/trainer/gnndelete_embdis.py | import os
import time
import wandb
from tqdm import tqdm, trange
import torch
import torch.nn as nn
from torch_geometric.utils import negative_sampling, k_hop_subgraph
from torch_geometric.loader import GraphSAINTRandomWalkSampler
from .base import Trainer
from ..evaluation import *
from ..utils import *
def Bounded... | 13,600 | 42.453674 | 135 | py |
GNNDelete | GNNDelete-main/framework/models/gin.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import GINConv
class GIN(nn.Module):
def __init__(self, args, **kwargs):
super().__init__()
self.conv1 = GINConv(nn.Linear(args.in_dim, args.hidden_dim))
self.conv2= GINConv(nn.Linear(args.h... | 1,373 | 28.869565 | 76 | py |
GNNDelete | GNNDelete-main/framework/models/rgat.py | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import roc_auc_score, average_precision_score
from typing import Optional
import torch
import torch.nn.functional as F
from torch import Tensor
from torch.nn import Parameter, ReLU
from torch_scatter import scat... | 16,095 | 40.061224 | 97 | py |
GNNDelete | GNNDelete-main/framework/models/deletion.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from . import GCN, GAT, GIN, RGCN, RGAT
class DeletionLayer(nn.Module):
def __init__(self, dim, mask):
super().__init__()
self.dim = dim
self.mask = mask
self.deletion_weight = nn.Parame... | 6,273 | 31.340206 | 102 | py |
GNNDelete | GNNDelete-main/framework/models/rgcn.py | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import RGCNConv, FastRGCNConv
from sklearn.metrics import roc_auc_score, average_precision_score
class RGCN(nn.Module):
def __init__(self, args, num_nodes, num_edge_type, **kwargs):
super().__init... | 1,689 | 31.5 | 97 | py |
GNNDelete | GNNDelete-main/framework/models/gcn.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
class GCN(nn.Module):
def __init__(self, args, **kwargs):
super().__init__()
self.conv1 = GCNConv(args.in_dim, args.hidden_dim)
self.conv2 = GCNConv(args.hidden_dim, args.out_dim)
... | 1,039 | 27.888889 | 76 | py |
GNNDelete | GNNDelete-main/framework/models/__init__.py | from .gcn import GCN
from .gat import GAT
from .gin import GIN
from .rgcn import RGCN
from .rgat import RGAT
from .deletion import GCNDelete, GATDelete, GINDelete, RGCNDelete, RGATDelete | 186 | 30.166667 | 77 | py |
GNNDelete | GNNDelete-main/framework/models/gat.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import GATConv
class GAT(nn.Module):
def __init__(self, args, **kwargs):
super().__init__()
self.conv1 = GATConv(args.in_dim, args.hidden_dim)
self.conv2 = GATConv(args.hidden_dim, args.out_dim)
... | 1,039 | 27.888889 | 76 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.