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 |
|---|---|---|---|---|---|---|
rosbag2 | rosbag2-master/ros2bag/ros2bag/verb/reindex.py | # Copyright 2021 DCS Corporation, All Rights Reserved.
#
# 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... | 1,577 | 31.875 | 77 | py |
rosbag2 | rosbag2-master/ros2bag/ros2bag/verb/burst.py | # Copyright 2022 Open Source Robotics Foundation, Inc.
#
# 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,632 | 43.12381 | 98 | py |
rosbag2 | rosbag2-master/ros2bag/ros2bag/verb/record.py | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# 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... | 12,576 | 47.748062 | 98 | py |
rosbag2 | rosbag2-master/ros2bag/ros2bag/verb/play.py | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# 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... | 10,706 | 49.985714 | 99 | py |
rosbag2 | rosbag2-master/ros2bag/ros2bag/verb/info.py | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# 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... | 1,336 | 35.135135 | 74 | py |
rosbag2 | rosbag2-master/ros2bag/ros2bag/verb/convert.py | # Copyright 2021 Amazon.com Inc or its Affiliates
#
# 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 a... | 2,024 | 38.705882 | 97 | py |
rosbag2 | rosbag2-master/ros2bag/ros2bag/verb/__init__.py | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# 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... | 1,328 | 28.533333 | 74 | py |
rosbag2 | rosbag2-master/ros2bag/ros2bag/verb/list.py | # Copyright 2020 Open Source Robotics Foundation, Inc.
#
# 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,688 | 45.696203 | 99 | py |
baryrat | baryrat-master/test.py | import numpy as np
import baryrat
import scipy.interpolate
import flamp
import gmpy2
import pytest
def test_init():
nodes = [0, 1, 2]
values = [1, 2, 0]
weights = [0.5, -1, 0.5]
r = baryrat.BarycentricRational(nodes, values, weights)
X = np.linspace(0, 2, 100)
assert np.allclose(r(X), -3/2*X**... | 13,991 | 32.473684 | 99 | py |
baryrat | baryrat-master/setup.py | from setuptools import setup
import os
from io import open # Py2.7 compatibility
def readme():
with open(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'README.md'
), encoding='utf8') as fp:
return fp.read()
setup(
name = 'baryrat',
version = '2.1.0',... | 1,067 | 28.666667 | 76 | py |
baryrat | baryrat-master/baryrat.py | """A Python package for barycentric rational approximation.
"""
import numpy as np
import scipy.linalg
import math
try:
import gmpy2
import flamp
except ImportError:
gmpy2 = None
flamp = None
else:
from gmpy2 import mpfr, mpc
__version__ = '2.1.0'
def _is_mp_array(x):
"""Checks whether `x` i... | 52,100 | 37.79449 | 118 | py |
baryrat | baryrat-master/docs/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 2,008 | 33.050847 | 79 | py |
VAD | VAD-master/configure/ACAM/config.py | lr = 0.0001
dropout_rate = 0.5
max_epoch = 100
batch_size = 128
w = 19
u = 9
glimpse_hidden = 128
bp_hidden = 128
glimpse_out = 128
nGlimpse = 7
lstm_cell_size = 128
action_hidden_1 = 256
action_hidden_2 = 256
| 210 | 14.071429 | 21 | py |
VAD | VAD-master/configure/LSTM/config.py | lr=0.0001 # Learning rate
max_epoch=100 # Max epoch
dropout_rate=0.5 # Dropout rate
target_delay=5 # Target delay of LSTM
num_layers=3 # The number of layers of LSTM
cell_size=256 # LSTM cell size
seq_len=20 # Sequence length
num_batches=200 # The number of batches
... | 379 | 37 | 62 | py |
VAD | VAD-master/configure/DNN/config.py | lr=0.0001
dropout_rate=0.5
max_epoch=100
batch_size=128
w=19
u=9
num_hidden_1=512
num_hidden_2=512
| 99 | 10.111111 | 16 | py |
VAD | VAD-master/configure/bDNN/config.py | lr = 0.0001
dropout_rate = 0.5
max_epoch = 1000
batch_size = 128
w = 19
u = 9
num_hidden_1 = 512
num_hidden_2 = 512
| 116 | 12 | 18 | py |
VAD | VAD-master/lib/python/parallel_random_search.py | import VAD_Proposed as VR
import numpy as np
import tensorflow as tf
import pickle
from multiprocessing import Process, Queue
'''random search script'''
distribution_num = 7
test_num = 1
max_epoch = 101 # 351
gpu_0_append = 4
def get_parameter(min_val, max_val, shape):
x = np.random.rand(shape[0], shape[1])
... | 2,291 | 25.344828 | 140 | py |
VAD | VAD-master/lib/python/graph_save.py | import os, argparse
import time
import tensorflow as tf
# The original freeze_graph function
# from tensorflow.python.tools.freeze_graph import freeze_graph
dir = os.path.dirname(os.path.realpath(__file__))
def freeze_graph(model_dir, output_dir, output_node_names):
"""Extract the sub graph defined by the outp... | 2,946 | 39.930556 | 123 | py |
VAD | VAD-master/lib/python/parallel_result_load.py | import pickle
with open('/home/sbie/storage2/result/result_proposed_soft.p', 'rb') as f:
result = pickle.load(f)
print("result_load") | 140 | 19.142857 | 74 | py |
VAD | VAD-master/lib/python/VAD_Proposed.py | import tensorflow as tf
import numpy as np
import utils as utils
import re
import data_reader_bDNN_v2 as dr
import os, sys
import time
import subprocess
# import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import scipy.io as sio
from sklearn import metrics
from matplotlib import colors, cm, pyplot as plt
... | 35,070 | 38.229306 | 152 | py |
VAD | VAD-master/lib/python/freeze_graph.py | 0 | 0 | 0 | py | |
VAD | VAD-master/lib/python/feat_ex.py | import sys
sys.path.insert(0, './lib/python')
import VAD_Proposed as Vp
import VAD_DNN as Vd
import VAD_bDNN as Vb
import VAD_LSTM_2 as Vl
import scipy.io as sio
import os, getopt
# norm_dir = "./norm_data"
# data_dir = "./sample_data"
# ckpt_name = '/model9918and41.ckpt-2'
# model_dir = "./saved_model"
# valid_batch_... | 1,566 | 28.018519 | 119 | py |
VAD | VAD-master/lib/python/eer_test.py | import numpy as np
import scipy.io as sio
import sys
import os, sys, getopt
from sklearn import metrics
from scipy.optimize import brentq
from scipy.interpolate import interp1d
def eer(pred, label):
fpr, tpr, thresholds = metrics.roc_curve(label, pred, pos_label=1)
# valid_auc = metrics.auc(fpr, tpr)
eer... | 1,104 | 21.1 | 73 | py |
VAD | VAD-master/lib/python/medium-tffreeze-2.py | import tensorflow as tf
def load_graph(frozen_graph_filename):
# We load the protobuf file from the disk and parse it to retrieve the
# unserialized graph_def
with tf.gfile.GFile(frozen_graph_filename, "rb") as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
# Then, w... | 623 | 40.6 | 75 | py |
VAD | VAD-master/lib/python/utils.py | # Utils used with tensorflow implementation
import tensorflow as tf
import numpy as np
import scipy.misc as misc
import os, sys
from six.moves import urllib
import tarfile
import zipfile
import scipy.io
import re
import data_reader_bDNN_v2 as dr
import data_reader_DNN_v2 as dnn_dr
import data_reader_RNN as rnn_dr
fro... | 29,265 | 37.106771 | 129 | py |
VAD | VAD-master/lib/python/model.py | import tensorflow as tf
import numpy as np
import utils as utils
import re
import data_reader_bDNN as dr
from tensorflow.contrib import rnn
SEED = 1
w = 19 # w default = 19
u = 9 # u default = 9
assert (w-1) % u == 0, "w-1 must be divisible by u"
num_features = 768 # for MRCG feature
bdnn_winlen = (((w-1) / u) * 2)... | 14,036 | 37.563187 | 127 | py |
VAD | VAD-master/lib/python/VAD_LSTM.py | import tensorflow as tf
import numpy as np
import utils_jskim as utils
import re
import data_reader_RNN as dr
import os
import matplotlib.pyplot as plt
from tensorflow.contrib import rnn
from sklearn import metrics
import time
FLAGS = tf.flags.FLAGS
SEED = 1
tf.set_random_seed(SEED)
tf.flags.DEFINE_string('mode', "tes... | 20,915 | 38.389831 | 180 | py |
VAD | VAD-master/lib/python/temp_save.py | import graph_save as gs
prj_dir = '/home/sbie/storage3/github/VAD_Toolkit/VAD'
gs.freeze_graph(prj_dir + '/saved_model/temp/temp_LSTM', prj_dir + '/saved_model/graph/LSTM', 'model_1/soft_pred,model_1/raw_labels')
# gs.freeze_graph(prj_dir + '/saved_model/temp_ACAM', prj_dir + '/saved_model/ACAM', 'model_1/logits,mod... | 338 | 41.375 | 133 | py |
VAD | VAD-master/lib/python/data_reader_bDNN.py | import numpy as np
import os
import glob
import utils
import scipy.io as sio
class DataReader(object):
def __init__(self, input_dir, output_dir, norm_dir, w=19, u=9, name=None, pad=None):
# print(name + " data reader initialization...")
self._input_dir = input_dir
self._output_dir = outpu... | 5,838 | 37.668874 | 121 | py |
VAD | VAD-master/lib/python/update_ckpt.py | import sys
sys.path.insert(0, './lib/python')
import VAD_Proposed as Vp
import VAD_DNN as Vd
import VAD_bDNN as Vb
import VAD_LSTM_2 as Vl
import scipy.io as sio
import os, getopt
import glob
# norm_dir = "./norm_data"
# data_dir = "./sample_data"
# ckpt_name = '/model9918and41.ckpt-2'
# model_dir = "./saved_model"
# ... | 2,142 | 30.985075 | 109 | py |
VAD | VAD-master/lib/python/path_setting.py |
class PathSetting(object):
def __init__(self, prj_dir, model):
save_dir = prj_dir + '/data/feat'
train_dir = save_dir + '/train'
valid_dir = save_dir + '/valid'
logs_dir = prj_dir + '/logs/' + model
self.logs_dir = logs_dir
self.initial_logs_dir = logs_dir
... | 468 | 26.588235 | 45 | py |
VAD | VAD-master/lib/python/VAD_test.py | import sys
sys.path.insert(0, './lib/python')
import VAD_Proposed as Vp
import VAD_DNN as Vd
import VAD_bDNN as Vb
import VAD_LSTM_2 as Vl
import scipy.io as sio
import graph_test as graph_test
import os, getopt
import glob
from time import time
# norm_dir = "./norm_data"
# data_dir = "./sample_data"
# ckpt_name = '/... | 5,318 | 35.9375 | 143 | py |
VAD | VAD-master/lib/python/graph_test.py | import tensorflow as tf
import utils as utils
import numpy as np
import os, sys
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = ""
def bdnn_prediction(batch_size, logits, threshold=0.6, w=19, u=9):
bdnn_batch_size = batch_size + 2*w
result = np.zeros((bdnn_batch_size, 1))
... | 12,936 | 40.598071 | 143 | py |
VAD | VAD-master/lib/python/VAD_LSTM_2.py | import tensorflow as tf
import numpy as np
import utils as utils
import re
import data_reader_RNN as dr
import sys, os
import matplotlib.pyplot as plt
from tensorflow.contrib import rnn
from sklearn import metrics
import time
FLAGS = tf.flags.FLAGS
SEED = 1
tf.set_random_seed(SEED)
tf.flags.DEFINE_string('mode', "trai... | 23,706 | 37.92775 | 180 | py |
VAD | VAD-master/lib/python/VAD_bDNN.py | import tensorflow as tf
import numpy as np
import utils as utils
import re
import data_reader_bDNN_v2 as dr
import os, sys
from sklearn import metrics
from scipy.optimize import brentq
from scipy.interpolate import interp1d
# FLAGS = tf.flags.FLAGS
#
# tf.flags.DEFINE_string('mode', "test", "mode : train/ test [defaul... | 20,473 | 37.197761 | 134 | py |
VAD | VAD-master/lib/python/train.py | import sys
sys.path.insert(0, './lib/python')
import VAD_Proposed as Vp
import VAD_DNN as Vd
import VAD_bDNN as Vb
import VAD_LSTM_2 as Vl
import scipy.io as sio
import os, getopt
import time
import graph_save as gs
import path_setting as ps
# norm_dir = "./norm_data"
# data_dir = "./sample_data"
# ckpt_name = '/model... | 4,385 | 32.227273 | 127 | py |
VAD | VAD-master/lib/python/utils_jskim.py | # Utils used with tensorflow implementation
import tensorflow as tf
import numpy as np
import scipy.misc as misc
import os, sys
from six.moves import urllib
import tarfile
import zipfile
import scipy.io
import re
import data_reader_bDNN as dr
import data_reader_RNN as dr3
__author__ = 'Juntae'
def vad_test(m_eval,... | 30,172 | 41.023677 | 153 | py |
VAD | VAD-master/lib/python/data_reader_DNN.py | import numpy as np
import os
import glob
import utils
import scipy.io as sio
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
class DataReader(object):
def __init__(self, input_dir, output_dir, norm_dir, w=19, u=9, name=None, pad=None):
# print(name.title() + " data reader initialization.... | 6,592 | 36.674286 | 121 | py |
VAD | VAD-master/lib/python/VAD_DNN.py | import tensorflow as tf
import numpy as np
import utils as utils
import re
import data_reader_DNN_v2 as dr
import os, sys
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from sklearn import metrics
from scipy.optimize import brentq
from scipy.interpolate import interp1d
mode = 'test'
file_dir = "/hom... | 19,112 | 37.45674 | 134 | py |
VAD | VAD-master/lib/python/data_reader_RNN.py | import numpy as np
import os
import glob
import utils
import scipy.io as sio
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
class DataReader(object):
def __init__(self, input_dir, output_dir, norm_dir, target_delay=19, u=9, name=None):
# print(name.title() + " data reader initialization... | 8,149 | 35.222222 | 123 | py |
VAD | VAD-master/lib/python/data_reader_bDNN_v2.py | import numpy as np
import os
import glob
import utils
import scipy.io as sio
class DataReader(object):
def __init__(self, input_dir, output_dir, norm_dir, w=19, u=9, name=None):
# print(name + " data reader initialization...")
self._input_dir = input_dir
self._output_dir = output_dir
... | 7,108 | 37.427027 | 123 | py |
VAD | VAD-master/lib/python/data_reader_DNN_v2.py | import numpy as np
import os
import glob
import utils
import scipy.io as sio
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
class DataReader(object):
def __init__(self, input_dir, output_dir, norm_dir, w=19, u=9, name=None):
# print(name.title() + " data reader initialization...")
... | 6,299 | 34.393258 | 121 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/train_on_simulation.py | from typing import List
import os
import time
import argparse
from argparse import Namespace
import logging
from scipy import sparse as sp #type: ignore
import numpy as np #type: ignore
from sklearn.utils.extmath import randomized_svd #type: ignore
from tqdm import tqdm #type: ignore
import pandas as pd #type: ignore... | 11,375 | 43.787402 | 111 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/setup.py | from setuptools import setup, find_packages
print(find_packages())
setup(name='acgan',
version='1.0',
packages=['acgan'],
package_data={"acgan": ["py.typed"]}) | 178 | 24.571429 | 43 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/NCF_validation.py | from typing import List
import os
import time
import argparse
from argparse import Namespace
import logging
from scipy import sparse as sp #type: ignore
import numpy as np #type: ignore
from sklearn.utils.extmath import randomized_svd #type: ignore
from tqdm import tqdm #type: ignore
import pandas as pd #type: ignore... | 1,725 | 28.254237 | 99 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/robust_simulation.py | """Script to generate recommendation data from simulation"""
import argparse
from argparse import Namespace
import os
import pandas as pd #type: ignore
import torch #type: ignore
import numpy as np #type: ignore
from scipy import sparse as sp #type: ignore
from tqdm import tqdm #type: ignore
from acgan.data import Rat... | 6,198 | 43.92029 | 102 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/ncf_utils.py | '''
This code copied directly from https://github.com/hexiangnan/neural_collaborative_filtering
in order to replicate their results.
Created on Aug 8, 2016
Processing datasets.
@author: Xiangnan He ([email protected])
'''
import scipy.sparse as sp
import numpy as np
class Dataset(object):
'''
classdocs
... | 5,181 | 30.02994 | 131 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/run.py | from typing import List
from scipy import sparse as sp #type: ignore
import numpy as np #type: ignore
from sklearn.utils.extmath import randomized_svd #type: ignore
from tqdm import tqdm
from acgan.recommender import SVDRecommender, BPRRecommender, eval_test
from acgan.module import FactorModel
# te = sp.load_npz('d... | 1,278 | 29.452381 | 75 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/train_on_real.py | from typing import List
import os
import time
import argparse
from argparse import Namespace
import logging
from scipy import sparse as sp #type: ignore
import numpy as np #type: ignore
from sklearn.utils.extmath import randomized_svd #type: ignore
from tqdm import tqdm #type: ignore
import pandas as pd #type: ignore... | 10,239 | 43.716157 | 125 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/simulation.py | """Script to generate recommendation data from simulation"""
import argparse
from argparse import Namespace
import os
import pandas as pd #type: ignore
import torch #type: ignore
import numpy as np #type: ignore
from scipy import sparse as sp #type: ignore
from tqdm import tqdm #type: ignore
from acgan.data import Rat... | 6,208 | 44.654412 | 101 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/acgan/module.py | """Modules are to express the mathematical relationships between parameters.
Design note: The module shoudn't care about things like data transformations. It should be
as self-contained as possible. Dirty jobs should be done by the Model class which serves
as a bridge between reality(data) and the theory(module).
"""
... | 14,132 | 39.495702 | 134 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/acgan/data.py | import os
import argparse
import logging
from typing import Dict, List, Tuple, Optional, Set
import numpy as np # type: ignore
import pandas as pd # type: ignore
from scipy import sparse as sp # type: ignore
import torch # type: ignore
from torch.utils import data # type: ignore
from numpy.random import RandomSta... | 11,006 | 34.621359 | 117 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/acgan/recommender.py | from typing import List, Optional, Tuple, Dict, Set
import time
import logging
from tqdm import tqdm # type: ignore
from scipy import sparse as sp # type: ignore
import numpy as np # type: ignore
from sklearn.utils.extmath import randomized_svd # type: ignore
import torch # type: ignore
from torch import nn # ty... | 42,175 | 38.306617 | 152 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/acgan/eval.py | from typing import List
from scipy import sparse as sp #type: ignore
import numpy as np #type: ignore
from sklearn.utils.extmath import randomized_svd #type: ignore
from tqdm import tqdm #type: ignore
from acgan.recommender import Recommender
| 246 | 23.7 | 62 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/acgan/__init__.py | 0 | 0 | 0 | py | |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/data/lastfm/lastfm.py | """
from http://files.grouplens.org/datasets/hetrec2011/hetrec2011-lastfm-2k.zip
"""
import os
import re
import sys
import gzip
import json
from datetime import datetime
import pandas as pd
import numpy as np
from acgan.data import time_based_split
from sklearn.preprocessing import LabelEncoder
data_path='.'
names = ... | 1,932 | 35.471698 | 100 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/data/ml-1m/ml_1m.py | #download data from :http://files.grouplens.org/datasets/movielens/ml-1m.zip
import os
import pandas as pd
import numpy as np
from acgan.data import time_based_split
data_path='.'
names = ['uidx', 'iidx', 'rating', 'ts']
dtype = {'uidx':int, 'iidx':int, 'rating':float, 'ts':float}
ratings = pd.read_csv(os.path.join(d... | 596 | 27.428571 | 76 | py |
Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System | Adversarial-Counterfactual-Learning-and-Evaluation-for-Recommender-System-main/data/books/book_data.py | """
Steps to download the data:
pip install gdown
gdown 'https://drive.google.com/uc?id=1roQnVtWxVE1tbiXyabrotdZyUY7FA82W'
or go to: https://github.com/MengtingWan/goodreads
"""
import os
import re
import sys
import gzip
import json
from datetime import datetime
import pandas as pd
import numpy as np
from acgan.data ... | 2,414 | 34 | 100 | py |
imgclsmob | imgclsmob-master/eval_ch.py | """
Script for evaluating trained model on Chainer (validate/test).
"""
import os
import time
import logging
import argparse
from sys import version_info
from chainer import global_config
from chainercv.utils import apply_to_iterator
from chainercv.utils import ProgressHook
from common.logger_utils import initiali... | 9,650 | 29.638095 | 120 | py |
imgclsmob | imgclsmob-master/eval_ke.py | """
Script for evaluating trained model on Keras (validate/test).
"""
import argparse
import time
import logging
import keras
from common.logger_utils import initialize_logging
from keras_.utils import prepare_ke_context, prepare_model, get_data_rec, get_data_generator, backend_agnostic_compile
def parse_args():... | 6,665 | 27.365957 | 118 | py |
imgclsmob | imgclsmob-master/load_model.py | """
Script for downloading model weights.
"""
import argparse
import numpy as np
def parse_args():
parser = argparse.ArgumentParser(description="Download model",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
"--model",
ty... | 1,326 | 23.574074 | 92 | py |
imgclsmob | imgclsmob-master/eval_gl.py | """
Script for evaluating trained model on MXNet/Gluon (validate/test).
"""
import os
import time
import logging
import argparse
from sys import version_info
from common.logger_utils import initialize_logging
from gluon.utils import prepare_mx_context, prepare_model
from gluon.utils import calc_net_weight_count, v... | 11,941 | 31.53951 | 117 | py |
imgclsmob | imgclsmob-master/sotabench.py | from torchbench.image_classification import ImageNet
from pytorch.pytorchcv.models.model_store import _model_sha1
from pytorch.pytorchcv.model_provider import get_model as ptcv_get_model
import torchvision.transforms as transforms
import torch
import math
from sys import version_info
# import os
for model_name, model... | 1,645 | 39.146341 | 109 | py |
imgclsmob | imgclsmob-master/train_tf2.py | """
Script for training model on TensorFlow 2.0.
"""
import os
import logging
import argparse
import numpy as np
import random
import tensorflow as tf
from common.logger_utils import initialize_logging
from tensorflow2.tf2cv.model_provider import get_model
from tensorflow2.dataset_utils import get_dataset_metainfo... | 8,479 | 28.041096 | 102 | py |
imgclsmob | imgclsmob-master/eval_pt.py | """
Script for evaluating trained model on PyTorch (validate/test).
"""
import os
import time
import logging
import argparse
from sys import version_info
from common.logger_utils import initialize_logging
from pytorch.utils import prepare_pt_context, prepare_model
from pytorch.utils import calc_net_weight_count, v... | 13,989 | 29.347072 | 120 | py |
imgclsmob | imgclsmob-master/eval_gl_det.py | """
Script for evaluating trained model on MXNet/Gluon (validate/test).
"""
import os
import time
import logging
import argparse
from sys import version_info
from common.logger_utils import initialize_logging
from gluon.utils import prepare_mx_context, prepare_model
from gluon.utils import calc_net_weight_count, v... | 11,409 | 31.140845 | 117 | py |
imgclsmob | imgclsmob-master/train_ke.py | """
Script for training model on Keras.
"""
import argparse
import time
import logging
import os
import numpy as np
import random
import keras
from keras.models import load_model
from keras.callbacks import ModelCheckpoint
import mxnet as mx
from common.logger_utils import initialize_logging
from keras_.utils impo... | 8,801 | 26.85443 | 118 | py |
imgclsmob | imgclsmob-master/eval_tf2.py | """
Script for evaluating trained model on TensorFlow 2.0 (validate/test).
"""
import os
import time
import logging
import argparse
from sys import version_info
import tensorflow as tf
from common.logger_utils import initialize_logging
from tensorflow2.utils import prepare_model
from tensorflow2.tf2cv.models.model... | 9,076 | 29.979522 | 117 | py |
imgclsmob | imgclsmob-master/prep_model.py | """
Script for preparing the model for publication.
"""
import os
import argparse
import subprocess
import shutil
import re
import hashlib
import zipfile
import pandas as pd
def parse_args():
"""
Parse python script parameters.
Returns:
-------
ArgumentParser
Resulted args.
"""
... | 9,068 | 30.380623 | 119 | py |
imgclsmob | imgclsmob-master/train_tf.py | """
Script for training model on TensorFlow.
"""
import argparse
import numpy as np
import random
from tensorpack.input_source import QueueInput
from tensorpack.utils import logger
from tensorpack.utils.gpu import get_num_gpu
from tensorpack import ModelSaver, ScheduledHyperParamSetter, EstimatedTimeLeft, Classifi... | 7,591 | 27.328358 | 119 | py |
imgclsmob | imgclsmob-master/convert_models.py | """
Script for converting models between frameworks (MXNet, Gluon, PyTroch, Chainer, Keras, TensorFlow).
"""
import argparse
import logging
import re
import numpy as np
from common.logger_utils import initialize_logging
def parse_args():
parser = argparse.ArgumentParser(description="Convert models (Gluon/PyT... | 87,933 | 51.435301 | 125 | py |
imgclsmob | imgclsmob-master/train_ch.py | """
Script for training model on Chainer.
"""
import os
import argparse
import numpy as np
import chainer
from chainer import training
from chainer.training import extensions
from chainer.serializers import save_npz
from common.logger_utils import initialize_logging
from chainer_.utils import prepare_ch_context, p... | 9,406 | 27.506061 | 120 | py |
imgclsmob | imgclsmob-master/eval_tf.py | """
Script for evaluating trained model on TensorFlow (validate/test).
"""
import argparse
import tqdm
import time
import logging
from tensorpack.predict import PredictConfig, FeedfreePredictor
from tensorpack.utils.stats import RatioCounter
from tensorpack.input_source import QueueInput, StagingInput
from common.... | 5,824 | 27.004808 | 99 | py |
imgclsmob | imgclsmob-master/train_gl_mealv2.py | """
Script for training model on MXNet/Gluon.
"""
import argparse
import time
import logging
import os
import random
import numpy as np
import mxnet as mx
from mxnet import gluon
from mxnet import autograd as ag
from common.logger_utils import initialize_logging
from common.train_log_param_saver import TrainLogP... | 33,553 | 32.188922 | 119 | py |
imgclsmob | imgclsmob-master/train_pt.py | """
Script for training model on PyTorch.
"""
import os
import time
import logging
import argparse
import random
import numpy as np
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.utils.data
from common.logger_utils import initialize_logging
from common.train_log_param_saver import TrainL... | 20,958 | 28.519718 | 119 | py |
imgclsmob | imgclsmob-master/__init__.py | 0 | 0 | 0 | py | |
imgclsmob | imgclsmob-master/train_gl.py | """
Script for training model on MXNet/Gluon.
"""
import argparse
import time
import logging
import os
import random
import numpy as np
import mxnet as mx
from mxnet import gluon
from mxnet import autograd as ag
from common.logger_utils import initialize_logging
from common.train_log_param_saver import TrainLogP... | 28,277 | 30.489978 | 119 | py |
imgclsmob | imgclsmob-master/chainer_/dataset_utils.py | """
Dataset routines.
"""
__all__ = ['get_dataset_metainfo', 'get_train_data_source', 'get_val_data_source', 'get_test_data_source']
from chainer.iterators import MultiprocessIterator
from .datasets.imagenet1k_cls_dataset import ImageNet1KMetaInfo
from .datasets.cub200_2011_cls_dataset import CUB200MetaInfo
from ... | 3,818 | 30.04878 | 106 | py |
imgclsmob | imgclsmob-master/chainer_/setup.py | from setuptools import setup, find_packages
from os import path
from io import open
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='chainercv2',
version='0.0.62',
description='Image classification and ... | 1,581 | 42.944444 | 120 | py |
imgclsmob | imgclsmob-master/chainer_/utils.py | import logging
import os
import cupy
from chainer import using_config, Variable
from chainer.function import no_backprop_mode
from chainer.backends import cuda
from chainer.backends.cuda import to_cpu
from chainer.serializers import load_npz
from .chainercv2.model_provider import get_model
from .metrics.metric import E... | 6,272 | 28.176744 | 116 | py |
imgclsmob | imgclsmob-master/chainer_/__init__.py | 0 | 0 | 0 | py | |
imgclsmob | imgclsmob-master/chainer_/chainercv2/__init__.py | 0 | 0 | 0 | py | |
imgclsmob | imgclsmob-master/chainer_/chainercv2/model_provider.py | from .models.alexnet import *
from .models.zfnet import *
from .models.vgg import *
from .models.bninception import *
from .models.resnet import *
from .models.preresnet import *
from .models.resnext import *
from .models.seresnet import *
from .models.sepreresnet import *
from .models.seresnext import *
from .models.s... | 39,465 | 34.813067 | 95 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/airnext.py | """
AirNeXt for ImageNet-1K, implemented in Chainer.
Original paper: 'Attention Inspiring Receptive-Fields Network for Learning Invariant Representations,'
https://ieeexplore.ieee.org/document/8510896.
"""
__all__ = ['AirNeXt', 'airnext50_32x4d_r2', 'airnext101_32x4d_r2', 'airnext101_32x4d_r16']
import os... | 11,883 | 30.356201 | 115 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/pspnet.py | """
PSPNet for image segmentation, implemented in Chainer.
Original paper: 'Pyramid Scene Parsing Network,' https://arxiv.org/abs/1612.01105.
"""
__all__ = ['PSPNet', 'pspnet_resnetd50b_voc', 'pspnet_resnetd101b_voc', 'pspnet_resnetd50b_coco',
'pspnet_resnetd101b_coco', 'pspnet_resnetd50b_ade20k', '... | 18,152 | 36.122699 | 115 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/dla.py | """
DLA for ImageNet-1K, implemented in Chainer.
Original paper: 'Deep Layer Aggregation,' https://arxiv.org/abs/1707.06484.
"""
__all__ = ['DLA', 'dla34', 'dla46c', 'dla46xc', 'dla60', 'dla60x', 'dla60xc', 'dla102', 'dla102x', 'dla102x2', 'dla169']
import os
import chainer.functions as F
from chainer import ... | 20,401 | 30.729393 | 120 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/proxylessnas.py | """
ProxylessNAS for ImageNet-1K, implemented in Chainer.
Original paper: 'ProxylessNAS: Direct Neural Architecture Search on Target Task and Hardware,'
https://arxiv.org/abs/1812.00332.
"""
__all__ = ['ProxylessNAS', 'proxylessnas_cpu', 'proxylessnas_gpu', 'proxylessnas_mobile', 'proxylessnas_mobile14',
... | 14,977 | 34.918465 | 118 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/shufflenetv2.py | """
ShuffleNet V2 for ImageNet-1K, implemented in Chainer.
Original paper: 'ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design,'
https://arxiv.org/abs/1807.11164.
"""
__all__ = ['ShuffleNetV2', 'shufflenetv2_wd2', 'shufflenetv2_w1', 'shufflenetv2_w3d2', 'shufflenetv2_w2']
import os
... | 12,350 | 32.291105 | 119 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/fishnet.py | """
FishNet for ImageNet-1K, implemented in Chainer.
Original paper: 'FishNet: A Versatile Backbone for Image, Region, and Pixel Level Prediction,'
http://papers.nips.cc/paper/7356-fishnet-a-versatile-backbone-for-image-region-and-pixel-level-prediction.pdf.
"""
__all__ = ['FishNet', 'fishnet99', 'fishnet1... | 21,336 | 31.625382 | 115 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/hrnet.py | """
HRNet for ImageNet-1K, implemented in Chainer.
Original paper: 'Deep High-Resolution Representation Learning for Visual Recognition,'
https://arxiv.org/abs/1908.07919.
"""
__all__ = ['hrnet_w18_small_v1', 'hrnet_w18_small_v2', 'hrnetv2_w18', 'hrnetv2_w30', 'hrnetv2_w32', 'hrnetv2_w40',
'hrne... | 23,990 | 34.914671 | 115 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/fcn8sd.py | """
FCN-8s(d) for image segmentation, implemented in Chainer.
Original paper: 'Fully Convolutional Networks for Semantic Segmentation,' https://arxiv.org/abs/1411.4038.
"""
__all__ = ['FCN8sd', 'fcn8sd_resnetd50b_voc', 'fcn8sd_resnetd101b_voc', 'fcn8sd_resnetd50b_coco',
'fcn8sd_resnetd101b_coco', 'f... | 15,722 | 37.34878 | 115 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/selecsls.py | """
SelecSLS for ImageNet-1K, implemented in Chainer.
Original paper: 'XNect: Real-time Multi-person 3D Human Pose Estimation with a Single RGB Camera,'
https://arxiv.org/abs/1907.00837.
"""
__all__ = ['SelecSLS', 'selecsls42', 'selecsls42b', 'selecsls60', 'selecsls60b', 'selecsls84']
import os
import cha... | 12,601 | 32.967655 | 115 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/inceptionv4.py | """
InceptionV4 for ImageNet-1K, implemented in Chainer.
Original paper: 'Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning,'
https://arxiv.org/abs/1602.07261.
"""
__all__ = ['InceptionV4', 'inceptionv4']
import os
import chainer.functions as F
import chainer.links as L
fro... | 20,057 | 31.721044 | 115 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/regnet.py | """
RegNet for ImageNet-1K, implemented in Chainer.
Original paper: 'Designing Network Design Spaces,' https://arxiv.org/abs/2003.13678.
"""
__all__ = ['RegNet', 'regnetx002', 'regnetx004', 'regnetx006', 'regnetx008', 'regnetx016', 'regnetx032', 'regnetx040',
'regnetx064', 'regnetx080', 'regnetx120'... | 24,754 | 33.622378 | 118 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/icnet.py | """
ICNet for image segmentation, implemented in Chainer.
Original paper: 'ICNet for Real-Time Semantic Segmentation on High-Resolution Images,'
https://arxiv.org/abs/1704.08545.
"""
__all__ = ['ICNet', 'icnet_resnetd50b_cityscapes']
import os
import chainer.functions as F
from chainer import Chain
from f... | 12,461 | 30.549367 | 115 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/mobilenetb.py | """
MobileNet(B) with simplified depthwise separable convolution block for ImageNet-1K, implemented in Chainer.
Original paper: 'MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications,'
https://arxiv.org/abs/1704.04861.
"""
__all__ = ['mobilenetb_w1', 'mobilenetb_w3d4', 'mobilen... | 3,571 | 33.019048 | 113 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/shakedropresnet_cifar.py | """
ShakeDrop-ResNet for CIFAR/SVHN, implemented in Chainer.
Original paper: 'ShakeDrop Regularization for Deep Residual Learning,' https://arxiv.org/abs/1802.02375.
"""
__all__ = ['CIFARShakeDropResNet', 'shakedropresnet20_cifar10', 'shakedropresnet20_cifar100', 'shakedropresnet20_svhn']
import os
import cha... | 11,397 | 32.721893 | 119 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/inceptionresnetv1.py | """
InceptionResNetV1 for ImageNet-1K, implemented in Chainer.
Original paper: 'Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning,'
https://arxiv.org/abs/1602.07261.
"""
__all__ = ['InceptionResNetV1', 'inceptionresnetv1', 'InceptionAUnit', 'InceptionBUnit', 'InceptionCUnit'... | 18,521 | 32.554348 | 117 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/scnet.py | """
SCNet for ImageNet-1K, implemented in Chainer.
Original paper: 'Improving Convolutional Networks with Self-Calibrated Convolutions,'
http://mftp.mmcheng.net/Papers/20cvprSCNet.pdf.
"""
__all__ = ['SCNet', 'scnet50', 'scnet101', 'scneta50', 'scneta101']
import os
import chainer.functions as F
import ch... | 15,771 | 31.187755 | 115 | py |
imgclsmob | imgclsmob-master/chainer_/chainercv2/models/igcv3.py | """
IGCV3 for ImageNet-1K, implemented in Chainer.
Original paper: 'IGCV3: Interleaved Low-Rank Group Convolutions for Efficient Deep Neural Networks,'
https://arxiv.org/abs/1806.00178.
"""
__all__ = ['IGCV3', 'igcv3_w1', 'igcv3_w3d4', 'igcv3_wd2', 'igcv3_wd4']
import os
import chainer.functions as F
impo... | 10,203 | 32.788079 | 115 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.