query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Function at the heart of RCTorch, train a network on multiple rounds of crossvalidated train/test info, then return the average error. This method also deals with dispatching mutliple series to the objective function if there are multiple, and aggregates the returned scores by averaging.
def execute_objective(arguments): #later call define_tr_val from within this function for speedup. #score, pred_ = self.define_tr_val() #just get the train and test... cv_samples, parallel_arguments, parameters, windowsOS, id_ = arguments device = parallel_arguments["device"] declaration_args ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(clf, X, y, ntrials=100, test_size=0.2) :\n\n train_error = 0\n test_error = 0\n ### ========== TODO : START ========== ###\n # compute cross-validation error over ntrials\n # hint: use train_test_split (be careful of the parameters)\n for i in range(0,ntrials, 1):\n #get the valu...
[ "0.68135214", "0.6388464", "0.6343493", "0.6326529", "0.6313902", "0.627731", "0.61531216", "0.61406094", "0.61087924", "0.61046493", "0.60904646", "0.6060501", "0.6038475", "0.6031496", "0.60128665", "0.59967685", "0.5974265", "0.5957948", "0.5951136", "0.5942197", "0.593980...
0.0
-1
Makes sure all bounds feeded into GPyOpt are scaled to the domain [0, 1], to aid interpretation of convergence plots. Scalings are saved in instance parameters.
def normalize_bounds(self, bounds): scaled_bounds = [] scalings = [] intercepts = [] non_fixed_params = [] print(self.device) for name, domain in self.bounds.items(): # Get any fixed parmeters if type(domain) == int or ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def myscale(g, factor=1.0):\n g.setdata(factor * g.getdata())\n # if !g.frozen eq 0 then show", "def scale(self):\n return self._gev_bijector.scale", "def setup(self):\n if self.minimizer == \"shgo\":\n self._maxiter = 100\n else:\n self._maxiter = 1000\n if ...
[ "0.6217774", "0.6106262", "0.6076442", "0.5966637", "0.5942933", "0.58166665", "0.58008057", "0.5660049", "0.5658421", "0.5655743", "0.56344235", "0.560839", "0.5578738", "0.55561835", "0.5530794", "0.5524495", "0.55209935", "0.5518806", "0.5510932", "0.55013424", "0.54777133...
0.62791705
0
Denormalize arguments to feed into model.
def denormalize_bounds(self, normalized_arguments): denormalized_bounds = (normalized_arguments * self.bound_scalings) + self.bound_intercepts return denormalized_bounds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_args(self, args):\n return args", "def normalize_args(self, args):\n return self.metagraph.normalize_args(args)", "def normalize_args(self, args):\n if self._graph.flags.get('ignore_values', False):\n return tuple(_broaden(a, None) for a in args)\n else:\n ...
[ "0.6972853", "0.6739494", "0.66210634", "0.6308798", "0.6176821", "0.6088814", "0.6049809", "0.5997373", "0.58216965", "0.5803196", "0.57827723", "0.57243264", "0.5687452", "0.56658936", "0.56447923", "0.5638549", "0.5606782", "0.55959255", "0.5544403", "0.5543355", "0.551334...
0.0
-1
Constructs arguments for ESN input from input array. Does so by denormalizing and adding arguments not involved in optimization, like the random seed.
def construct_arguments(self, x): # Denormalize free parameters denormalized_values = self.denormalize_bounds(x) arguments = dict(zip(self.free_parameters, denormalized_values.flatten())) self.log_vars = ['connectivity', 'llambda', 'llambda2', 'enet_strength', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, total_args):\n\t\tself.alpha = 0.0\n\t\tself.salida = 0.0\n\t\tself.bias = pseudoaleatorio(-1.0, 1.0)\n\t\tself.pesos = []\n\t\tfor i in range(total_args):\n\t\t\tself.pesos.append(pseudoaleatorio(-1.0, 1.0))", "def __init__(self,nback=1,ntokens_pm=2,ntokens_og=3,stimdim=2,seed=99):\n np.ra...
[ "0.5619324", "0.5593154", "0.5440737", "0.53112406", "0.52345806", "0.5231647", "0.5197095", "0.51924103", "0.5169906", "0.5167056", "0.516215", "0.51010704", "0.5099438", "0.50905585", "0.5081436", "0.50773704", "0.50709444", "0.5070725", "0.506674", "0.5065923", "0.50571764...
0.55122995
2
Validates inputted data against errors in shape and common mistakes.
def validate_data(self, y, x=None, verbose=True): # Check dimensions if not self.ODE_order: if not y.ndim == 2: raise ValueError("y-array is not 2 dimensional, if ODE and you didn't provide y then x is one dim") if verbose and y.shape[0] < y.shape[1]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_input(self):\n self._validate_limits_cols_prefixed()\n self._validate_fillna_cols_prefixed()\n self._validate_ratio_input()", "def check_dims(self, data):\n if np.ndim(data) != 2:\n raise ValueError('Input data must be a two dimensional numpy array. '\n ...
[ "0.72307163", "0.72123903", "0.7099669", "0.70848185", "0.7062611", "0.7045674", "0.70427585", "0.703525", "0.7020206", "0.69853604", "0.695262", "0.6923969", "0.691496", "0.69091976", "0.69005466", "0.68764365", "0.6875079", "0.6870377", "0.68641317", "0.68603855", "0.683775...
0.6397586
54
Returns selected error metric on validation set.
def objective_function(self, parameters, train_y, validate_y, train_x=None, validate_x=None, random_seed=None): arguments = self.construct_arguments(self.range_bounds) # Build network esn = self.model(**arguments, activation_f = self.activation_function, plot = False, model_typ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yerr(self, i):\n return self.errors[1][i]", "def compute_fit_error(self, metric='MSE'):\n\n I = self.I.flatten()\n E = self.E.flatten()\n\n valid_matrics = {\n 'EVAR': explained_variance_score(I, E),\n 'MAE': mean_absolute_error(I, E),\n 'MSE': mea...
[ "0.60175335", "0.5955407", "0.59338146", "0.5866605", "0.5799263", "0.57727945", "0.5667554", "0.56660944", "0.56454545", "0.56128025", "0.5590303", "0.55492985", "0.552297", "0.54930365", "0.5492552", "0.5483789", "0.5453669", "0.54061", "0.54022264", "0.53941363", "0.537540...
0.0
-1
Splits training sets (X, y) into train and validate sets, in order to later compute multiple samples of the objective function.
def define_tr_val(self, inputs): #### #print("Hayden edit: parameters: " + str(parameters)) #print("Hayden edit: fixed parameters: " + str(self.fixed_parameters)) #print("Hayden edit: free parameters: " + str(self.free_parameters)) #### start_index, random_seed =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_train_valid_set(self):\n\n if not self.eq_train:\n X_train_high_level, X_valid_high_level, X_train_low_level, X_valid_low_level, train_w, valid_w, y_train, y_valid = train_test_split(self.X_train_high_level, self.X_train_low_level, self.train_weights, self.y_train,\n ...
[ "0.7453219", "0.739912", "0.7375244", "0.73498577", "0.71658945", "0.7158523", "0.71305346", "0.70896065", "0.7073784", "0.7066556", "0.7054637", "0.7036253", "0.6996273", "0.6977518", "0.6965935", "0.69633704", "0.6948049", "0.69358677", "0.6935264", "0.69336563", "0.6918491...
0.0
-1
This function builds a list of dictionairies with unique keys.
def build_unq_dict_lst(self, lst1, lst2, key1 = "start_index", key2 = "random_seed"): dict_lst = [] for i in range(len(lst1)): for j in range(len(lst2)): dictt = {} dictt[key1] = lst1[i] dictt[key2] = lst2[j] dict_lst.append(d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _unique(iterable):\n return list(dict.fromkeys(iterable))", "def unique(list_: List) -> List:\n return list(collections.OrderedDict.fromkeys(list_))", "def _uniq( list ) : \r\n \r\n d = {} \r\n for e in list : \r\n d[e] = 1 \r\n \r\n ...
[ "0.7014602", "0.69492906", "0.6941098", "0.6885813", "0.6830574", "0.68287224", "0.67020875", "0.6599733", "0.6556042", "0.6383938", "0.63837504", "0.6295457", "0.61819345", "0.61736625", "0.61508775", "0.61295223", "0.60576284", "0.6056202", "0.6035064", "0.6012629", "0.6012...
0.5868322
31
Splits training set into train and validate sets, and computes multiple samples of the objective function. This method also deals with dispatching multiple series to the objective function if there are multiple, and aggregates the returned scores by averaging.
def objective_sampler(self): # Get data #self.parameters = parameters training_y = self.y training_x = self.x # Set viable sample range if not self.ODE_order: #assert False viable_start = self.esn_burn_in # Get number of serie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_eval(model, train_set):\n num_train_batch = len(train_set)\n train_loss = np.zeros((num_train_batch, 1), dtype=float)\n train_acc = np.zeros((num_train_batch, 1), dtype=float)\n shuffle(train_set)\n for ibatch, batch in enumerate(train_set):\n result = model.train_on_batch({'input':...
[ "0.6511949", "0.64103603", "0.6384507", "0.63781327", "0.6243873", "0.62344897", "0.62201923", "0.6219357", "0.6212692", "0.61456156", "0.61324656", "0.61121434", "0.6080425", "0.60588187", "0.6051341", "0.6048353", "0.6033012", "0.59930754", "0.5992074", "0.5990621", "0.5988...
0.0
-1
If you are running rctorch in a jupyter notebook then this function displays live plots so that you can watch training if self.interactive = True.
def train_plot_update(self, pred_, validate_y, steps_displayed, elastic_losses = None, restart_triggered = False): if self.interactive: display.clear_output(wait=True) pred_2plot = pred_.detach().to("cpu") if not self.ODE_order: validate_y_2plot ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show(self) -> None:\n # if not called from notebook environment, ref to show_browser function.\n if not is_notebook():\n print(\n \"The plot will not show in a notebook environment, \"\n \"please try 'show_browser' if you want to open it in browser\",\n ...
[ "0.7196754", "0.7054279", "0.7005126", "0.6878387", "0.6878387", "0.6878387", "0.67734253", "0.6766458", "0.67658323", "0.66961825", "0.668899", "0.66447586", "0.6629516", "0.662015", "0.6619253", "0.6552591", "0.65489894", "0.65204173", "0.6483645", "0.6473154", "0.64325166"...
0.0
-1
This version of the RC helper function
def eval_objective(self, parameters, plot_type = "error", *args): # parameter_lst = [] # for i in range(parameters.shape[0]): # parameter_lst.append(self.construct_arguments(parameters[i, :])) parameter_lst = [self.construct_arguments(parameters[i, :]) for i in range(parameters.sha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cx():", "def _regr_basic():", "def CL(self):", "def test_rc(self):\n # no longer preserves case!\n self.assertEqual(self.RNA(\"UauCG-NR\").rc(), \"YN-CGAUA\")\n self.assertEqual(self.DNA(\"TatCG-NR\").rc(), \"YN-CGATA\")\n self.assertEqual(self.RNA(\"\").rc(), \"\")\n s...
[ "0.5890724", "0.58554274", "0.56417525", "0.5511166", "0.5441391", "0.54353964", "0.5365056", "0.5320655", "0.53201157", "0.51603585", "0.51603585", "0.51603585", "0.51603585", "0.51603585", "0.5128818", "0.51230246", "0.512259", "0.5111368", "0.50806105", "0.50806105", "0.50...
0.0
-1
Performs optimization (with crossvalidation). Uses Bayesian Optimization with Gaussian Process priors to optimize ESN hyperparameters.
def optimize(self, y = None, x=None, store_path=None, epochs = 25, learning_rate = 0.005, scoring_method = "mse", criterion = MSELoss(), reparam_f = None, ODE_criterion = None, init_conditions = None, scale = True, force = None, backprop_f = None, backprop = False, ode_coefs = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_bayesian_optimization(self):\n bounds = {'hunits': (self.hunits_lower, self.hunits_upper),\n 'embedding_dim': (self.embedding_dim_lower, self.embedding_dim_upper)}\n optimizer = BayesianOptimization(f=self.lstm_score, pbounds=bounds, random_state=1)\n optimizer.max...
[ "0.66671604", "0.64092016", "0.61563504", "0.61285573", "0.6119044", "0.60834605", "0.595369", "0.5945639", "0.59206283", "0.5905338", "0.5868431", "0.5819456", "0.5809728", "0.5799336", "0.57908994", "0.5787421", "0.5764173", "0.57335675", "0.5727176", "0.57238513", "0.57206...
0.0
-1
bool int Position > Space Constructs an instance of Space.
def __init__(self, on_railroad, space_type, adjacent): self.space_type = space_type self.on_railroad = on_railroad self.adjacent = adjacent
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_space(self):\n return self.pos == self.SPACE_POS", "def create_space(self):\n schema = SpaceSchema()\n data = {'show': str(self.show_id), 'show_title': self.show_title, 'space': self.location_array}\n space_object = schema.load(data)\n return space_object", "def test_exten...
[ "0.7008498", "0.621807", "0.59040236", "0.5801304", "0.56820416", "0.5652077", "0.5604434", "0.5552117", "0.5462722", "0.54436535", "0.54188234", "0.5411768", "0.5401182", "0.53933203", "0.53815204", "0.53607225", "0.5338166", "0.5291468", "0.5291468", "0.5270642", "0.5238398...
0.49680564
55
> iter(Position) Returns a generator of positions that are adjacent to this space.
def __iter__(self): return iter(self.adjacent)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iterate_adjacent(position):\n return iter(_board_graph[position])", "def __iter__(self):\n for p in self.positions(): # use same order as positons()\n yield p.element() # but yield each element", "def __iter__(self):\n for idx in range(0, self.Npoints):\n ...
[ "0.76649487", "0.75231266", "0.7464687", "0.7459826", "0.74092317", "0.7372811", "0.7335939", "0.72174793", "0.70786744", "0.7071331", "0.7003318", "0.6992895", "0.6963647", "0.6930121", "0.6862071", "0.67932606", "0.6783159", "0.671852", "0.66881925", "0.66803485", "0.654857...
0.7284025
7
Position Position > bool Checks if the given 2 positions are adjacent to each other.
def is_adjacent(v1, v2): return (v2 in _board_graph[v1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_adjacent(self, other: ops.Qid) -> bool:\n return (isinstance(other, GridQubit) and\n abs(self.row - other.row) + abs(self.col - other.col) == 1)", "def position_after(self, a, b):\n return self.position_at_least(a, b) and not self.position_equal(a, b)", "def position_equal(self,...
[ "0.7033602", "0.6725644", "0.6643974", "0.65933293", "0.6528447", "0.64954203", "0.6453956", "0.64282835", "0.6353031", "0.6318262", "0.6318167", "0.6300374", "0.6295051", "0.62813294", "0.62813294", "0.6238177", "0.62184185", "0.61997527", "0.61897445", "0.6187568", "0.61638...
0.6871998
1
Position > bool Checks if the give position is a camp
def is_camp(p): return _board_graph[p].space_type == CAMP
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __bool__(self):\n return (self.value == POS)", "def is_position_availible(self, position):\n return self.positions[position] == ' '", "def check_position(self, position):\n x_axis, y_axis = position\n try:\n return bool(self.full_map[x_axis][y_axis] not in \"#\"\n ...
[ "0.64722383", "0.64340055", "0.64084136", "0.63969594", "0.6365744", "0.6255603", "0.61885136", "0.6162032", "0.6148545", "0.6137229", "0.6058347", "0.6002783", "0.5990171", "0.59791565", "0.59631646", "0.591652", "0.5893191", "0.58920956", "0.58592474", "0.5839528", "0.58370...
0.6246878
6
Position > bool Checks if the given position is a headquarter
def is_headquarters(p): return _board_graph[p].space_type == HEADQUARTERS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_quarter_start(self) -> Index:\n return Index(self.to_series().dt.is_quarter_start)", "def positionTerminale(position):\n if(position['graines']['NORD']>=25 or position['graines']['SUD']>=25): \n return True \n for a in range(1,position['taille']+1):\n if(coupAutorise(position...
[ "0.6647186", "0.58659077", "0.584978", "0.57397217", "0.5682148", "0.5370651", "0.5325137", "0.53094614", "0.5295059", "0.5295059", "0.52834874", "0.5278531", "0.52409405", "0.5195752", "0.51897436", "0.5188449", "0.51745075", "0.5169134", "0.51610446", "0.5146895", "0.514187...
0.7563406
0
Position > iter(Position) Returns a generator of positions that are adjacent to the given position.
def iterate_adjacent(position): return iter(_board_graph[position])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjacent(self):\r\n d = 0\r\n while d < 4:\r\n a = self.getAdjacent(d)\r\n if a is not None:\r\n yield a\r\n d += 1", "def neighbor(self, position):\n if self.options['PeriOpt']:\n if position[0] == 0:\n yield (sel...
[ "0.7283339", "0.69497603", "0.69073117", "0.6686512", "0.6633959", "0.653778", "0.65283847", "0.65235907", "0.64112544", "0.6366553", "0.6237442", "0.62248063", "0.6151327", "0.6106118", "0.6073934", "0.60611665", "0.60321033", "0.60217905", "0.5955655", "0.59550315", "0.5945...
0.7694504
0
> Generates all positions and their connection for the board.
def generate_board(): b = open(_BOARD_FILE, "r").readlines() for line in b: raw = line.strip().split(" ") _board_graph[str_to_pos(raw[0])] = Space( (raw[1] == "R"), TYPE_MAP[raw[1]], {str_to_pos(str_pos) for str_pos in raw[2:]})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_board(self, size):\n # One entry for every node, if diamond all will be filled with pieces, if triange half of matrix including \n # diagonal from top left to bottom right will be filled\n self.board = [[False for i in range(size)] for j in range(size)] \n\n # One entry for every node pair (...
[ "0.6852624", "0.6730391", "0.6575972", "0.6565264", "0.6491741", "0.64670163", "0.6461841", "0.63448685", "0.6327465", "0.62439626", "0.6235739", "0.61992", "0.618114", "0.6179558", "0.6164701", "0.6148134", "0.6132428", "0.6116731", "0.6064113", "0.60538304", "0.6053184", ...
0.61497575
15
Convert json response to entity.
def _convert_to_entity(entry_element): entity = TableEntity() properties = {} edmtypes = {} odata = {} for name, value in entry_element.items(): if name.startswith("odata."): odata[name[6:]] = value elif name.endswith("@odata.type"): edmtypes[name[:-11]] = v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_entities_handler(response):\n\n if response.status_code != HTTP_CODE_OK:\n raise HttpError('HTTP GET for Entity Set {0} failed with status code {1}'\n .format(self._name, response.status_code), response)\n\n content = response.json()\n\n return con...
[ "0.64894706", "0.63945675", "0.63127697", "0.617892", "0.60494703", "0.60353273", "0.5970655", "0.59585863", "0.58664626", "0.58491504", "0.58155817", "0.5804504", "0.5749443", "0.5749443", "0.5718962", "0.5709732", "0.5708076", "0.57002693", "0.5680176", "0.5665328", "0.5662...
0.0
-1
Extracts the etag from the response headers.
def _extract_etag(response): if response and response.headers: return response.headers.get("etag") return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def etag(self):\n return self.raw.get(\"etag\")", "def getetag(self, path):\n etag = None\n instance = self.rdmc.app.monolith.path(path)\n if instance:\n etag = (\n instance.resp.getheader(\"etag\")\n if \"etag\" in instance.resp.getheaders()\n...
[ "0.7184431", "0.6997888", "0.6979557", "0.6752053", "0.6752053", "0.6752053", "0.6752053", "0.6752053", "0.6752053", "0.6752053", "0.67385346", "0.66871834", "0.66871834", "0.66871834", "0.66871834", "0.66871834", "0.66871834", "0.66871834", "0.66871834", "0.66871834", "0.668...
0.83126473
0
Extract list entity continuation headers from token.
def _extract_continuation_token(continuation_token): if not continuation_token: return None, None try: return continuation_token.get("PartitionKey"), continuation_token.get("RowKey") except AttributeError as exc: raise ValueError("Invalid continuation token format.") from exc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _retrieveContinuation(self, token):\n if token in self._continuations:\n _ignore_timestamp, things, kind = self._continuations[token]\n del self._continuations[token]\n else:\n things = None\n kind = None\n return things, kind", "def parse_toke...
[ "0.5588204", "0.53894943", "0.52932835", "0.5233644", "0.519129", "0.51626325", "0.51218164", "0.51026356", "0.5056054", "0.504202", "0.50148374", "0.5014546", "0.49950254", "0.49693838", "0.49416015", "0.49219742", "0.48803505", "0.48798403", "0.48698643", "0.4850413", "0.48...
0.60859376
0
Req 2 mapa de lps
def optionThree(catalog): ans = controller.pointsInterconnection(catalog) item_map = folium.Map(location=[25.557547, -24.568953], zoom_start=2) for landinpoint in lt.iterator(ans[0]): item = mp.get(catalog['landingpoints'], landinpoint)['value']['info'] print('Nombre:', item['id'], '\tLugar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intercambiar(mapa, mapa2):\n for e in mapa.bloqueadas:\n mapa2.bloqueadas.append(e)", "def map():", "def __getSimple(self):\n resp2={}\n for item in self.tesult: \n if item==self.RESPONSE:\n for item1 in self.response():\n ...
[ "0.5747746", "0.5600041", "0.5511264", "0.54483414", "0.5341221", "0.5251067", "0.52389675", "0.52224195", "0.5148562", "0.50524735", "0.50481427", "0.50481427", "0.5031429", "0.50157976", "0.4950536", "0.49193513", "0.49080384", "0.48979896", "0.48953548", "0.48906115", "0.4...
0.5620923
1
Usa la libreria de folium para crear un mapa que muestra el camino entre las capitales de los dos paises
def printMapDijkstra(catalog, path): # Datos de la primera capital al primer lp (Las captales van de rojo!) firstElement = stack.pop(path) vertexA = firstElement['vertexA'] # Primera Capital vertexB = firstElement['vertexB'].split('-')[:1][0] vertexA_info = mp.get(catalog['landingpoints'], vertexA)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_folium_map(self):", "def _set_folium_map(self):\n m = Map(features=[self], width=self._width, height=self._height)\n self._folium_map = m.draw()", "def create_map(films, pop_locations, year, loc_of_user):\n world_map = folium.Map()\n\n fg = folium.FeatureGroup(name=\"Film\")\n f...
[ "0.72090447", "0.6518688", "0.63825166", "0.62834024", "0.6216852", "0.61821413", "0.61816084", "0.6174961", "0.6174961", "0.61664915", "0.60756654", "0.6016085", "0.6007033", "0.5979304", "0.5963628", "0.5938241", "0.5932106", "0.59305054", "0.59143853", "0.5903357", "0.5888...
0.0
-1
Mean absolute error regression loss.
def mean_absolute_error(y_true, y_pred, *, sample_weight=..., multioutput=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_absolute_error(self):\n print('Mean absolute error regression loss: ' + str(mean_absolute_error(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def mean_squared_error(self):\n print('Mean squ...
[ "0.82092834", "0.75316024", "0.73240125", "0.715579", "0.7151401", "0.71104527", "0.70501304", "0.69472337", "0.6935832", "0.69307333", "0.6914975", "0.6842285", "0.68380743", "0.6825987", "0.6815631", "0.68115884", "0.6807899", "0.68038934", "0.6796058", "0.6781836", "0.6764...
0.71803063
3
Mean absolute percentage error regression loss. Note here that we do not represent the output as a percentage in range [0, 100]. Instead, we represent it in range [0, 1/eps]. Read more in the
def mean_absolute_percentage_error(y_true, y_pred, sample_weight=..., multioutput=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_absolute_percentage_error(y_true, y_pred):\n output_errors = 100*np.average(np.abs(y_true - y_pred)/y_true)\n return np.average(output_errors)", "def mean_absolute_percentage_error(y_true, y_pred):\n if len(y_true.shape) > 1 or len(y_pred.shape) > 1:\n raise TypeError('Arrays need to be ...
[ "0.7640588", "0.75075644", "0.7496276", "0.7408573", "0.7408573", "0.72649664", "0.723839", "0.71749765", "0.7093771", "0.70465857", "0.6919462", "0.6886161", "0.6827793", "0.68212134", "0.66761184", "0.6675", "0.6651786", "0.6617233", "0.65321493", "0.65271723", "0.6506483",...
0.76742464
0
Mean squared error regression loss.
def mean_squared_error(y_true, y_pred, *, sample_weight=..., multioutput=..., squared=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_squared_error(self):\n print('Mean squared error regression loss: ' + str(mean_squared_error(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def mean_squared_error(self, y_out, y):\n loss = np....
[ "0.8255571", "0.77297866", "0.7600188", "0.7562676", "0.7498284", "0.72682816", "0.7266238", "0.7260783", "0.72425824", "0.72425824", "0.72248286", "0.72134584", "0.7193884", "0.71936274", "0.7186965", "0.7167719", "0.7165839", "0.71417433", "0.7107558", "0.7069114", "0.70598...
0.70676416
20
Mean squared logarithmic error regression loss.
def mean_squared_log_error(y_true, y_pred, *, sample_weight=..., multioutput=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_squared_logarithmic_error(y_true, y_pred):\n y_pred = tensor_conversion.convert_to_tensor_v2_with_dispatch(y_pred)\n y_true = math_ops.cast(y_true, y_pred.dtype)\n first_log = math_ops.log(backend.maximum(y_pred, backend.epsilon()) + 1.)\n second_log = math_ops.log(backend.maximum(y_true, backend.epsi...
[ "0.7162771", "0.7122939", "0.7013533", "0.69584405", "0.6901689", "0.6872533", "0.68515307", "0.6828593", "0.6821297", "0.68030465", "0.6796868", "0.6756596", "0.6753186", "0.67320395", "0.6705772", "0.66960394", "0.6684708", "0.66746044", "0.6660656", "0.6647128", "0.6643087...
0.70238346
2
Median absolute error regression loss. Median absolute error output is nonnegative floating point. The best value
def median_absolute_error(y_true, y_pred, *, multioutput=..., sample_weight=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def median_absolute_error(self):\n print('Median absolute error regression loss: ' + str(median_absolute_error(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def abs_median_error(self) -> float:\n ...
[ "0.79329205", "0.7356527", "0.6854822", "0.68116266", "0.6647143", "0.65790784", "0.6537083", "0.6533045", "0.6438318", "0.64356536", "0.6396276", "0.63813764", "0.6341217", "0.6334593", "0.6299007", "0.6280763", "0.6274058", "0.62736255", "0.62697214", "0.6242023", "0.622260...
0.76567715
1
Explained variance regression score function. Best possible score is 1.0, lower values are worse.
def explained_variance_score(y_true, y_pred, *, sample_weight=..., multioutput=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def explained_variance_score(self):\n print('Explained variance score: ' + str(explained_variance_score(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def variance_scorer(x, y):\n scores = [np.var(column) for ...
[ "0.7782597", "0.6995945", "0.69856685", "0.6739042", "0.67074156", "0.67061454", "0.6617293", "0.6617293", "0.6542628", "0.6501592", "0.649731", "0.64949507", "0.6450904", "0.64444697", "0.64215237", "0.63731253", "0.63682324", "0.6336768", "0.6336768", "0.6336768", "0.632655...
0.67390394
4
R^2 (coefficient of determination) regression score function. Best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a R^2 score of 0.0.
def r2_score(y_true, y_pred, *, sample_weight=..., multioutput=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def r2_score(self):\n print('R^2 (coefficient of determination) regression score function: ' +\n str(r2_score(self.model.dataset.get_y_test(), self.model.get_predicted())))", "def r2_score_fitted(y_true, y_pred):\n lr = LinearRegression(fit_intercept=True)\n y_true = np.array(y_true).re...
[ "0.8335419", "0.79704547", "0.77934617", "0.76882344", "0.7580721", "0.74633163", "0.71447515", "0.70602864", "0.7025899", "0.6944365", "0.6924056", "0.6916455", "0.6890862", "0.6889857", "0.68797195", "0.6865232", "0.68274724", "0.68088925", "0.67936134", "0.6687272", "0.666...
0.6984878
9
max_error metric calculates the maximum residual error.
def max_error(y_true, y_pred): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_error(self):\n print('Maximum residual error: ' + str(max_error(self.model.dataset.get_y_test(), self.model.get_predicted())))", "def max_error(self) -> float:\n return float(np.max(np.abs(self._flattened_errors())))", "def max_abs_error(self) -> float:\n return np.max(np.abs([self...
[ "0.82129323", "0.77675945", "0.71214306", "0.6661287", "0.65684533", "0.65526795", "0.64712137", "0.62896025", "0.62316483", "0.6153844", "0.61269325", "0.59729195", "0.5958617", "0.5942597", "0.5913103", "0.5869475", "0.58643377", "0.58599776", "0.5849801", "0.5825196", "0.5...
0.7023922
3
Mean Tweedie deviance regression loss.
def mean_tweedie_deviance(y_true, y_pred, *, sample_weight=..., power=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_poisson_deviance(self):\n print('Mean Poisson deviance regression loss: ' + str(mean_poisson_deviance(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def mean_gamma_deviance(self):\n prin...
[ "0.72087216", "0.7020211", "0.6806615", "0.6786812", "0.6548388", "0.64714855", "0.6461012", "0.6402578", "0.6331095", "0.6298561", "0.6288422", "0.62376523", "0.6191947", "0.6170224", "0.61566055", "0.6118376", "0.61077774", "0.61062914", "0.60998076", "0.6097593", "0.609759...
0.807882
0
Mean Poisson deviance regression loss. Poisson deviance is equivalent to the Tweedie deviance with the power parameter `power=1`.
def mean_poisson_deviance(y_true, y_pred, *, sample_weight=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_poisson_deviance(self):\n print('Mean Poisson deviance regression loss: ' + str(mean_poisson_deviance(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def mean_tweedie_deviance(y_true, y_pred, *,...
[ "0.84597147", "0.66956586", "0.66028935", "0.6221233", "0.5982527", "0.59586567", "0.5881107", "0.56975716", "0.5629051", "0.56143314", "0.5528999", "0.5501544", "0.5478511", "0.5445082", "0.54310447", "0.54274666", "0.5426783", "0.5422665", "0.5404065", "0.540162", "0.540162...
0.7705277
1
Mean Gamma deviance regression loss. Gamma deviance is equivalent to the Tweedie deviance with the power parameter `power=2`. It is invariant to scaling of the target variable, and measures relative errors.
def mean_gamma_deviance(y_true, y_pred, *, sample_weight=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_gamma_deviance(self):\n print('Mean Gamma deviance regression loss: ' + str(mean_gamma_deviance(self.model.dataset.get_y_test(),\n self.model.get_predicted())))", "def mean_poisson_deviance(self):\n print('Mean ...
[ "0.83312625", "0.6755352", "0.6428788", "0.6200454", "0.5909379", "0.5906981", "0.58842605", "0.5782911", "0.57710636", "0.56851995", "0.5670326", "0.56645346", "0.5622362", "0.56072474", "0.5598907", "0.55700964", "0.55504924", "0.5529231", "0.5525843", "0.55211276", "0.5512...
0.75102615
1
Return an embed that contains the exception.
def _get_error_embed(self, title: str, body: str) -> Embed: return Embed( title=title, colour=Colours.soft_red, description=body )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_error_embed(self, title: str, body: str) -> Embed:\n return Embed(\n title=title,\n colour=0xFF0000,\n description=body,\n )", "def error_embed(self, message: str):\n embed = discord.Embed(color=discord.Color.red())\n embed.title = \"\"\n ...
[ "0.70701724", "0.7026596", "0.65724456", "0.62856364", "0.60045296", "0.5970829", "0.59310895", "0.5897974", "0.5858693", "0.58173764", "0.58153445", "0.5798883", "0.5796214", "0.5735364", "0.57222617", "0.57210505", "0.56536776", "0.55875224", "0.5586819", "0.5551298", "0.55...
0.7072802
0
Provide generic command error handling. Error handling is deferred to any local error handler, if present. This is done by checking for the presence of a `handled` attribute on the error. Error handling emits a single error message in the invoking context `ctx` and a log message,
async def on_command_error(self, ctx: Context, e: errors.CommandError) -> None: command = ctx.command if hasattr(e, "handled"): log.trace(f"Command {command} had its error already handled locally; ignoring.") return debug_message = ( f"Command {command} invo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def on_command_error(self, ctx, error):\n\n # This prevents any commands with local handlers being handled here in on_command_error.\n if hasattr(ctx.command, 'on_error'):\n return\n\n ignored = (commands.CommandNotFound, commands.UserInputError)\n\n # Allows us to chec...
[ "0.76441735", "0.7575327", "0.75575596", "0.75218976", "0.7139422", "0.71180403", "0.70349246", "0.7033922", "0.6987191", "0.6763354", "0.6703136", "0.66731495", "0.66147363", "0.6507387", "0.650727", "0.6412765", "0.6384094", "0.63713896", "0.6319018", "0.620888", "0.6202594...
0.7748827
0
Return a prepared `help` command invocation coroutine.
async def send_command_help(self, ctx: Context) -> None: if ctx.command: self.bot.help_command.context = ctx await ctx.send_help(ctx.command) return await ctx.send_help()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _help(self):\n self.onecmd('help')", "async def help(ctx, command:str=None):\n if command == None:\n embed = assemble_embed(\n title=\"Looking for help?\",\n desc=(\"Hey there, I'm a resident bot of Scioly.org!\\n\\n\" +\n \"On Discord, you can send me comman...
[ "0.75976574", "0.7578193", "0.7457174", "0.7355775", "0.73405033", "0.72280246", "0.7172304", "0.7154413", "0.7137024", "0.7116726", "0.7116726", "0.7111586", "0.7106586", "0.7106586", "0.7106586", "0.7106586", "0.7091075", "0.70806426", "0.70587206", "0.705207", "0.70486647"...
0.69552404
28
Attempt to invoke the silence or unsilence command if invoke with matches a pattern.
async def try_silence(self, ctx: Context) -> bool: silence_command = self.bot.get_command("silence") if not silence_command: log.debug("Not attempting to parse message as `shh`/`unshh` as could not find `silence` command.") return False command = ctx.invoked_with.lower()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _run(vendor, **kwargs):\n if os.path.isfile('stop'):\n return None\n # This only works well if the logger's formatter has been set correctly.\n logging.debug('Running %s({fmt_kwargs}) ...', vendor.__name__, extra={'fmt_kwargs': kwargs})\n return vendor(**kwargs).run()", "def filter(self, s...
[ "0.49114773", "0.48788896", "0.48660362", "0.48127654", "0.48059168", "0.48024642", "0.4799675", "0.4703732", "0.46873048", "0.46738335", "0.46524504", "0.46363908", "0.46357155", "0.46301818", "0.46191686", "0.460999", "0.4579304", "0.4568367", "0.45615396", "0.45612645", "0...
0.5630745
0
Attempt to display a tag by interpreting the command name as a tag name. The invocation of tags get respects its checks. Any CommandErrors raised will be handled by `on_command_error`, but the `invoked_from_error_handler` attribute will be added to the context to prevent infinite recursion in the case of a CommandNotFo...
async def try_get_tag(self, ctx: Context) -> None: tags_cog = self.bot.get_cog("Tags") if not tags_cog: log.debug("Not attempting to parse message as a tag as could not find `Tags` cog.") return tags_get_command = tags_cog.get_command_ctx maybe_tag_name = ctx.inv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_tag_command(self, ctx):\n await self.get_tag(ctx)", "def func(self):\n if not self.args:\n return self.display_tags()\n super(CmdArxTag, self).func()", "def tag_cmd(context, json, name):\n store: Store = context.obj[\"store\"]\n LOG.info(\"Fetch tags\")\n ...
[ "0.6515155", "0.6264933", "0.6097251", "0.59668833", "0.5863284", "0.5552771", "0.55231833", "0.55163765", "0.5469529", "0.53831303", "0.5352281", "0.5327914", "0.5314861", "0.529864", "0.5292355", "0.52810186", "0.5239061", "0.52387", "0.52375", "0.52153635", "0.52134526", ...
0.662568
0
Attempt to run eval or timeit command with triple backticks directly after command.
async def try_run_fixed_codeblock(self, ctx: Context) -> bool: msg = copy.copy(ctx.message) command, sep, end = msg.content.partition("```") msg.content = command + " " + sep + end new_ctx = await self.bot.get_context(msg) if new_ctx.command is None: return False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backtick(cmd, input=None, timeout=None):\n PIPE = subprocess.PIPE\n stdin = PIPE if input is not None else None\n return subprocess.check_output(cmd, stdin=stdin, stderr=PIPE,\n universal_newlines=True,\n timeout=timeout)", "def exe...
[ "0.6119423", "0.581478", "0.56552666", "0.5594058", "0.55659336", "0.5521741", "0.5521741", "0.55122864", "0.54629916", "0.54199374", "0.53596467", "0.5357504", "0.5277461", "0.52723086", "0.52422655", "0.5236987", "0.5225021", "0.5224723", "0.5219171", "0.520724", "0.5110147...
0.0
-1
Sends user similar commands if any can be found.
async def send_command_suggestion(self, ctx: Context, command_name: str) -> None: # No similar tag found, or tag on cooldown - # searching for a similar command raw_commands = [] for cmd in self.bot.walk_commands(): if not cmd.hidden: raw_commands += (cmd.name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _query_commands(self):\n # TODO: make this work\n self.player.respond(\"Hi there! Ask me to play artists or songs. \"\n \"I can also find songs that are similar to other \"\n \"artists.\")", "def _send_custom_commands_after_welcome(self, con...
[ "0.6808523", "0.65629894", "0.64231116", "0.632939", "0.62583196", "0.6256796", "0.6255763", "0.61863035", "0.61725885", "0.61473215", "0.61381584", "0.6126272", "0.6038647", "0.6038119", "0.6028124", "0.6009447", "0.6007465", "0.5997941", "0.5966272", "0.5958318", "0.5903161...
0.60866976
12
Send an error message in `ctx` for UserInputError, sometimes invoking the help command too.
async def handle_user_input_error(self, ctx: Context, e: errors.UserInputError) -> None: if isinstance(e, errors.MissingRequiredArgument): embed = self._get_error_embed("Missing required argument", e.param.name) self.bot.stats.incr("errors.missing_required_argument") elif isinsta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def ticker_error(ctx, error):\n print(error)\n if isinstance(error, commands.UserInputError):\n await ctx.send(\"Invalid input.\")\n else:\n await ctx.send(\"Oops, something bad happened..\")", "async def help_error(self, ctx, error):\n await self.log_error_and_apologize(ctx, ...
[ "0.712171", "0.70414114", "0.6898544", "0.63807166", "0.630528", "0.62828434", "0.6276545", "0.62387955", "0.62291414", "0.6223708", "0.6164131", "0.60974765", "0.60968906", "0.6075964", "0.60698235", "0.6060255", "0.6027322", "0.6005236", "0.5989822", "0.5957479", "0.5935911...
0.79300207
0
Send an error message in `ctx` for certain types of CheckFailure.
async def handle_check_failure(ctx: Context, e: errors.CheckFailure) -> None: bot_missing_errors = ( errors.BotMissingPermissions, errors.BotMissingRole, errors.BotMissingAnyRole ) if isinstance(e, bot_missing_errors): ctx.bot.stats.incr("errors.b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _failed(self, msg):\n self.log(msg)\n self.result.passed = False\n self.result.add_error(msg)\n self.log(u\"Failed\")", "def error(ctx, flow):\n ctx.log(\"error\")", "def error(update, context):\n logger.warning(f'caused error {context.error}')", "def test_error_control(...
[ "0.60246116", "0.5896615", "0.58233225", "0.58143854", "0.5786445", "0.56219566", "0.5606722", "0.5545335", "0.5539042", "0.5516704", "0.550029", "0.54476047", "0.544695", "0.5430611", "0.5427206", "0.5410872", "0.541001", "0.5401988", "0.53921306", "0.53902113", "0.53895056"...
0.71992475
0
Send an error message in `ctx` for ResponseCodeError and log it.
async def handle_api_error(ctx: Context, e: ResponseCodeError) -> None: if e.status == 404: log.debug(f"API responded with 404 for command {ctx.command}") await ctx.send("There does not seem to be anything matching your query.") ctx.bot.stats.incr("errors.api_error_404") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_error(self, status_code, **kwargs):\n exc_info = kwargs.get(\"exc_info\")\n message = \"\"\n if exc_info:\n message = self.extract_message(exc_info)\n if not message:\n message = responses.get(status_code, \"Unknown HTTP Error\")\n\n # this cannot b...
[ "0.71094215", "0.69790447", "0.68559957", "0.6612752", "0.6503821", "0.65010816", "0.64997864", "0.6492574", "0.64858484", "0.648568", "0.6457176", "0.6434795", "0.64113706", "0.63517714", "0.63488925", "0.6336582", "0.6322579", "0.63142663", "0.63038105", "0.6278051", "0.627...
0.6887602
2
Send a generic error message in `ctx` and log the exception as an error with exc_info.
async def handle_unexpected_error(ctx: Context, e: errors.CommandError) -> None: await ctx.send( f"Sorry, an unexpected error occurred. Please let us know!\n\n" f"```{e.__class__.__name__}: {e}```" ) ctx.bot.stats.incr("errors.unexpected") with push_scope() as s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exception(self, msg, *args, **kwargs):\n ex = sys.exc_info()[1]\n\n if hasattr(ex, '_monocle'):\n args = args + (format_tb(ex),)\n self.logger.error('%s\\n%%s' % msg, *args, **kwargs)\n else:\n super(Adapter, self).exception(msg, *args, **kwargs)", "async...
[ "0.66102415", "0.6521973", "0.65208805", "0.6511823", "0.6496838", "0.64238614", "0.6343548", "0.6298833", "0.6289678", "0.62591517", "0.61192894", "0.6117967", "0.6110379", "0.60824025", "0.6081935", "0.60816187", "0.60814667", "0.6074158", "0.60646653", "0.60445", "0.603465...
0.0
-1
Load the ErrorHandler cog.
async def setup(bot: Bot) -> None: await bot.add_cog(ErrorHandler(bot))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_error_handler(app):\n app.register_error_handler(Exception, global_handler)\n return app", "def _set_error_handler(self):\n if self.on_error:\n error_step = self.context.root.path_to_step(self.on_error)\n self._on_error_handler = error_step.run", "def get_error_handl...
[ "0.69155324", "0.6595718", "0.65654486", "0.6458123", "0.62834316", "0.6152041", "0.57470226", "0.56880206", "0.5637985", "0.5609302", "0.5580768", "0.5541755", "0.5477142", "0.54422736", "0.5419221", "0.538743", "0.53578484", "0.53414106", "0.5339533", "0.5326992", "0.524064...
0.5387246
16
Generates a tipsy snapshot from the initial conditions object ICobj. Returns snapshot, param
def snapshot_gen(ICobj): # Constants G = SimArray(1.0,'G') kB = SimArray(1.0,'k') # ------------------------------------ # Load in things from ICobj # ------------------------------------ # snapshot file name snapshotName = ICobj.settings.filenames.snapshotName # particle positi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snapshot_gen(self):\n \n # Generate snapshot\n snapshot, snapshot_param = make_snapshot.snapshot_gen(self._parent)\n # Save to ICobj\n self._parent.snapshot = snapshot\n self._parent.snapshot_param = snapshot_param", "def test_snapshot(self):\n converter = Ins...
[ "0.57171977", "0.52551705", "0.51138514", "0.5079848", "0.50731844", "0.500941", "0.49984103", "0.498946", "0.4946346", "0.4926859", "0.48875278", "0.48804834", "0.48735443", "0.4870587", "0.48191464", "0.48191464", "0.4816881", "0.47846153", "0.47815368", "0.47701958", "0.47...
0.6311167
0
Return the possibly of a file being consumable by this plugin.
def verifyfile(self, path): return ( super(InventoryModule, self).verify_file(path) and path.endswith((self.NAME + ".yaml", self.NAME + ".yml")))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isBasedInHiddenFile(self):\n #type: () -> Optional[bool]\n return (\n None if self.realFileName is None #if before\n else self.realFileName != self.fileName\n )", "def getInFile( self ):\n return self.file", "def is_file(self):\n return self.type ==...
[ "0.5852709", "0.57894", "0.57791126", "0.57624125", "0.57588744", "0.5749567", "0.5709253", "0.56813145", "0.56744784", "0.567032", "0.5590263", "0.558216", "0.5562728", "0.55623823", "0.54860914", "0.54860914", "0.54860914", "0.5484788", "0.54812306", "0.5476542", "0.5463961...
0.0
-1
[settable, onlineonly] Total uservisible file (inode) count, i.e., maximum number of uservisible files (inodes) that this referenced file system can currently hold. If the referenced file system is restricted or offline, a value of 0 is returned.
def fs_files_total(self): return self._fs_files_total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_maxfiles_used(self):\n return self._fs_maxfiles_used", "def n_total_files(self):\n return len(self.fileinfo)", "def fs_files_used(self):\n return self._fs_files_used", "def fs_files_private_used(self):\n return self._fs_files_private_used", "def fileCount(self):\n ...
[ "0.7082203", "0.70292205", "0.67417777", "0.66801584", "0.66782624", "0.6589247", "0.6580722", "0.6553939", "0.6536609", "0.6506965", "0.650572", "0.64885944", "0.64882696", "0.63858473", "0.6353019", "0.63459617", "0.6315808", "0.6264559", "0.62503463", "0.6221747", "0.62143...
0.69523025
2
[not settable, onlineonly] The number of uservisible files currently in use on the referenced file system.
def fs_maxfiles_used(self): return self._fs_maxfiles_used
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_files_used(self):\n return self._fs_files_used", "def fs_files_private_used(self):\n return self._fs_files_private_used", "def fileCount(self):\n pass", "def getFileCount(self) -> int:\n ...", "def numberFiles(self):\n return self.n", "def __number_of_files(self)...
[ "0.75745016", "0.74626404", "0.72624356", "0.72596025", "0.70048213", "0.6969848", "0.69370127", "0.6878165", "0.67919236", "0.6769306", "0.6725484", "0.6696836", "0.6693496", "0.6692481", "0.663346", "0.6595896", "0.6586411", "0.6556981", "0.65504795", "0.6541895", "0.652519...
0.7229248
4
[not settable, onlineonly] Number of bytes still available in the referenced file system. If the referenced file system is restricted or offline, a value of 0 is returned.
def fs_size_available(self): return self._fs_size_available
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_bytes(self):\n if self._num_bytes is None:\n status, info = self._resource._file.stat(\n timeout=(0 if self._timeout is None else self._timeout)\n )\n if not status.ok:\n raise OSError(\n \"\"\"XRootD error: {0}\nin fi...
[ "0.7215966", "0.7215966", "0.715566", "0.70915985", "0.7042157", "0.7033947", "0.69954884", "0.68875164", "0.68428534", "0.6819091", "0.6789879", "0.678698", "0.67142147", "0.6713598", "0.6698187", "0.665003", "0.66352886", "0.6621122", "0.6597673", "0.65947264", "0.6516065",...
0.7171732
2
[not settable, onlineonly] The percentage of disk space saved by eliminating the duplicated blocks on the referenced file system.
def fs_sis_percent_saved(self): return self._fs_sis_percent_saved
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disk_usage(path):\n st = os.statvfs(path)\n free = (st.f_bavail * st.f_frsize)\n total = (st.f_blocks * st.f_frsize)\n used = (st.f_blocks - st.f_bfree) * st.f_frsize\n try:\n percent = ret = (float(used) / total) * 100\n except ZeroDivisionError:\n percent = 0\n # NB: t...
[ "0.67411596", "0.6688065", "0.65487635", "0.65090346", "0.6501265", "0.6407541", "0.63741", "0.634771", "0.62821704", "0.6267542", "0.62378645", "0.6228783", "0.62119985", "0.6169301", "0.60772586", "0.60668004", "0.60660887", "0.604889", "0.60474837", "0.6035398", "0.6018677...
0.54536784
81
[not settable, onlineonly] The percentage of disk space currently in use based on uservisible file (inode) count on the referenced file system.
def fs_percent_inode_used_capacity(self): return self._fs_percent_inode_used_capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disk_usage(path):\n st = os.statvfs(path)\n free = (st.f_bavail * st.f_frsize)\n total = (st.f_blocks * st.f_frsize)\n used = (st.f_blocks - st.f_bfree) * st.f_frsize\n try:\n percent = ret = (float(used) / total) * 100\n except ZeroDivisionError:\n percent = 0\n # NB: t...
[ "0.7925914", "0.7788018", "0.7767886", "0.7538284", "0.7479627", "0.7402273", "0.7383282", "0.73624295", "0.7339972", "0.72335976", "0.71510816", "0.71314514", "0.7105864", "0.7075663", "0.70739603", "0.7053933", "0.693317", "0.68960637", "0.68912286", "0.6873249", "0.6799669...
0.75687283
3
[not settable, onlineonly] The amount of data in bytes that is shared by more than one instance on the referenced file system.
def fs_sis_shared_space(self): return self._fs_sis_shared_space
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def BytesTransferred(self) -> int:", "def getSize(self) -> long:\n ...", "def fs_size_used(self):\n return self._fs_size_used", "def fs_hybrid_cache_size_total(self):\n return self._fs_hybrid_cache_size_total", "def size(self):\n size = 0\n size += self.data.size * sys.ge...
[ "0.68554944", "0.64408404", "0.6434519", "0.6402334", "0.6395444", "0.6376144", "0.6370729", "0.63375413", "0.6309336", "0.6301092", "0.6285541", "0.62808436", "0.6274288", "0.62670445", "0.62670445", "0.625912", "0.6246595", "0.6227414", "0.6222847", "0.6217756", "0.6205837"...
0.0
-1
[not settable, always] The largest value to which the fsmaxfilesavailable parameter can be increased by reconfiguration,
def fs_maxfiles_possible(self): return self._fs_maxfiles_possible
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_maxfiles_available(self):\n return self._fs_maxfiles_available", "def fs_maxfiles_used(self):\n return self._fs_maxfiles_used", "def max_files(self):\n\n return 10 ** self.int_len(self.cnt_files())", "def fs_size_available(self):\n return self._fs_size_available", "def by...
[ "0.82712835", "0.8090931", "0.71663946", "0.6656941", "0.6646011", "0.6620783", "0.64894843", "0.6332437", "0.6332305", "0.6286847", "0.62757057", "0.62750083", "0.6236155", "0.61510867", "0.6074842", "0.60359365", "0.60282034", "0.59874076", "0.5982692", "0.59755796", "0.597...
0.82997
0
[not settable, onlineonly] The total disk space in bytes that is saved by storing only one copy of the duplicated blocks on the referenced file system.
def fs_sis_saved_space(self): return self._fs_sis_saved_space
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_space_used():\n fs.get_space_used()", "def fs_size_used(self):\n return self._fs_size_used", "def fs_size_total(self):\n return self._fs_size_total", "def fs_total_reserved_space(self):\n return self._fs_total_reserved_space", "def total_storage(self):\n return self._...
[ "0.7007065", "0.69417715", "0.691247", "0.6821893", "0.67845905", "0.6768419", "0.67492956", "0.67020994", "0.6646754", "0.661664", "0.654519", "0.65355194", "0.65176225", "0.6508093", "0.6500125", "0.6465935", "0.6442479", "0.643597", "0.64343685", "0.6417594", "0.6416107", ...
0.0
-1
[not settable, onlineonly] Number of inodes that can currently be stored on disk for uservisible files. This number will dynamically increase as more uservisible files are created.
def fs_inodefile_public_capacity(self): return self._fs_inodefile_public_capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_inodefile_private_capacity(self):\n return self._fs_inodefile_private_capacity", "def numberFiles(self):\n return self.n", "def fs_files_private_used(self):\n return self._fs_files_private_used", "def fs_maxfiles_used(self):\n return self._fs_maxfiles_used", "def n_total_...
[ "0.66479313", "0.6554679", "0.654066", "0.64726263", "0.6429585", "0.6394004", "0.63604003", "0.6303086", "0.62792194", "0.6225605", "0.6211433", "0.61757964", "0.60769045", "0.6028026", "0.59996945", "0.59917325", "0.5941016", "0.5920603", "0.5886062", "0.5861142", "0.586023...
0.62509674
9
This field represents space used by the sum of all data and metadata of all volumes in the aggregate in bytes.
def fs_volume_footprints(self): return self._fs_volume_footprints
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_storage(self):\n return self._total_storage", "def fs_size_total(self):\n return self._fs_size_total", "def _raw_itemsize(self):\n if _has_unicode_fields(self):\n total_itemsize = 0\n for field in self.dtype.fields.values():\n itemsize = field...
[ "0.69040895", "0.66636777", "0.66083217", "0.6533461", "0.62840825", "0.6274708", "0.62726444", "0.6241903", "0.62069184", "0.61999524", "0.61530226", "0.61474305", "0.612676", "0.61061084", "0.6102644", "0.6095368", "0.60950047", "0.6085195", "0.6085195", "0.6085195", "0.608...
0.0
-1
[not settable, onlineonly] Total size (in bytes) of the referenced file system . If the referenced file system is restricted or offline, a value 0 is returned.
def fs_size_total(self): return self._fs_size_total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_size_used(self):\n return self._fs_size_used", "def get_space_used():\n files = jobtracker.query(\"SELECT * FROM files \" \\\n \"WHERE status IN ('added', 'downloaded', 'unverified')\")\n\n total_size = 0\n for file in files:\n total_size += int(file['siz...
[ "0.7535778", "0.75355166", "0.75019115", "0.7463405", "0.74039775", "0.73530895", "0.7339242", "0.7317524", "0.7317351", "0.72994936", "0.7290265", "0.72876734", "0.7249945", "0.7235576", "0.7222606", "0.7210238", "0.7192857", "0.7184594", "0.7180609", "0.7180061", "0.7178904...
0.7842023
0
This field represents space used by filesystem metadata of the aggregate in bytes.
def fs_aggregate_metadata(self): return self._fs_aggregate_metadata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_size_used(self):\n return self._fs_size_used", "def my_size(self):\n return u\"{} bytes\".format(self.size)", "def storage_bytes(self) -> str:\n return pulumi.get(self, \"storage_bytes\")", "def fs_size_total(self):\n return self._fs_size_total", "def data_disk_size_gb(se...
[ "0.67690367", "0.65594494", "0.6533121", "0.6527707", "0.64676404", "0.6418522", "0.64120966", "0.6402265", "0.6383675", "0.6379889", "0.6374366", "0.63350016", "0.63348657", "0.6319338", "0.6319338", "0.62872714", "0.6284882", "0.6283727", "0.62647575", "0.6244635", "0.62438...
0.0
-1
[not settable, onlineonly] The total disk space in bytes that is reserved on the referenced file system. The reserved space is already counted in the used space, so this element can be used to see what portion of the used space represents space reserved for future use.
def fs_total_reserved_space(self): return self._fs_total_reserved_space
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_space_used():\n fs.get_space_used()", "def fs_percent_used_capacity(self):\n return self._fs_percent_used_capacity", "def available_space(self):\n # From http://stackoverflow.com/a/787832/732596\n s = os.statvfs(self.path)\n return (s.f_bavail * s.f_frsize) / 1024**2", ...
[ "0.7872437", "0.77098984", "0.76996523", "0.761195", "0.74873185", "0.7478342", "0.74753845", "0.7407428", "0.74053967", "0.7351825", "0.73261625", "0.7259881", "0.71839964", "0.715185", "0.70758784", "0.7032841", "0.70319766", "0.7028243", "0.70219475", "0.7009117", "0.69965...
0.82823014
0
[not settable, onlineonly] Number of system (not uservisible) files (inodes) used. If the referenced file system is restricted or offline, a value of 0 is returned.
def fs_files_private_used(self): return self._fs_files_private_used
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_maxfiles_used(self):\n return self._fs_maxfiles_used", "def fs_files_used(self):\n return self._fs_files_used", "def numberFiles(self):\n return self.n", "def fs_size_used(self):\n return self._fs_size_used", "def fs_maxfiles_possible(self):\n return self._fs_maxfi...
[ "0.7176069", "0.71455556", "0.6795118", "0.6650427", "0.6613002", "0.65911686", "0.65844214", "0.65790117", "0.6578183", "0.65556973", "0.6517203", "0.6508235", "0.6503883", "0.6498055", "0.6467044", "0.6464757", "0.64563286", "0.6447357", "0.6411767", "0.63070005", "0.627850...
0.7063733
2
[not settable, onlineonly] Number of bytes used in the referenced file system. If the referenced file system is restricted or offline, a value of 0 is returned.
def fs_size_used(self): return self._fs_size_used
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def usedspace(self):\n self.log.info(\"freespace\")\n nbytes = 0\n keys = list(self.downloads.keys())\n keys.sort()\n for key in keys:\n download = self.downloads[key]\n nbytes += download['size']\n self.log.info(\"returning:\" + str(nbytes))\n ...
[ "0.7420827", "0.72786707", "0.72786707", "0.7269325", "0.71914876", "0.71662307", "0.7160162", "0.7136105", "0.7135419", "0.70523435", "0.7033959", "0.7007181", "0.6840923", "0.68281364", "0.6804137", "0.67992747", "0.6791028", "0.67774755", "0.6768768", "0.6767286", "0.67621...
0.7629277
0
[not settable, onlineonly] Total cache size (in bytes) in a hybrid aggregate. If the referenced aggregate is restricted or offline, or if it is not a hybrid aggregate, a value of 0 is returned.
def fs_hybrid_cache_size_total(self): return self._fs_hybrid_cache_size_total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_size(self):\n return self.cachesize", "def get_size(self):\n return len(self.cache)", "def get_size(self) -> int:\n total_size = 0\n for entry in self.__entries:\n total_size += entry.get_size()\n return total_size", "def cache_size(self):\n retu...
[ "0.6754768", "0.671188", "0.65282655", "0.6520063", "0.64089966", "0.6407665", "0.63737583", "0.63638794", "0.6302466", "0.62790143", "0.6275713", "0.6260091", "0.62569165", "0.6254125", "0.62438375", "0.62292016", "0.62211895", "0.6212261", "0.6185322", "0.61822873", "0.6172...
0.79143655
0
[not settable, onlineonly] The percentage of disk space currently in use on the referenced file system.
def fs_percent_used_capacity(self): return self._fs_percent_used_capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disk_usage(self):\n self.monitoring_object['disk_usage'] =\\\n psutil.disk_usage('/')", "def disk_usage(path):\n st = os.statvfs(path)\n free = (st.f_bavail * st.f_frsize)\n total = (st.f_blocks * st.f_frsize)\n used = (st.f_blocks - st.f_bfree) * st.f_frsize\n try:\n ...
[ "0.7765354", "0.77051103", "0.7577086", "0.750689", "0.7416436", "0.73467296", "0.73366296", "0.7290818", "0.7214682", "0.7189561", "0.7112761", "0.71106875", "0.7087746", "0.7049418", "0.7022909", "0.69850135", "0.69742143", "0.69612396", "0.6953823", "0.6924519", "0.6905571...
0.78090465
0
[not settable, onlineonly] Number of inodes that can currently be stored on disk for system (not uservisible) files. This number will dynamically increase as more system files are created.
def fs_inodefile_private_capacity(self): return self._fs_inodefile_private_capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numberFiles(self):\n return self.n", "def fs_maxfiles_used(self):\n return self._fs_maxfiles_used", "def n_file(self):\n self.assert_is_dir_and_exists()\n n = 0\n for _ in self.select_file(recursive=True):\n n += 1\n return n", "def _get_os_file_quota(...
[ "0.67676884", "0.6694791", "0.6650884", "0.6619768", "0.66188973", "0.65584064", "0.65211874", "0.65172863", "0.6454269", "0.6412615", "0.6394347", "0.6388729", "0.6340381", "0.63259023", "0.62917686", "0.62876606", "0.62548697", "0.61729693", "0.61536944", "0.61416286", "0.6...
0.65342677
6
[not settable, onlineonly] Number of uservisible files (inodes) used in the referenced file system. If the referenced file system is restricted or offline, a value of 0 is returned.
def fs_files_used(self): return self._fs_files_used
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_files_private_used(self):\n return self._fs_files_private_used", "def fs_maxfiles_used(self):\n return self._fs_maxfiles_used", "def n_total_files(self):\n return len(self.fileinfo)", "def numberFiles(self):\n return self.n", "def __number_of_files(self):\n self.__...
[ "0.7214981", "0.7100775", "0.6683742", "0.6647139", "0.6588653", "0.6584798", "0.65275645", "0.6507867", "0.6462393", "0.6428048", "0.6423025", "0.6417021", "0.6347864", "0.63377476", "0.6323211", "0.6319013", "0.63131106", "0.62815505", "0.6277341", "0.6269649", "0.62391883"...
0.7142993
1
[not settable, always] The count of the maximum number of uservisible files currently allowable on the referenced file system.
def fs_maxfiles_available(self): return self._fs_maxfiles_available
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_maxfiles_possible(self):\n return self._fs_maxfiles_possible", "def max_files(self):\n\n return 10 ** self.int_len(self.cnt_files())", "def fs_maxfiles_used(self):\n return self._fs_maxfiles_used", "def getFileCount(self) -> int:\n ...", "def n_total_files(self):\n ...
[ "0.77681595", "0.7759587", "0.7476491", "0.71149945", "0.70994216", "0.7095124", "0.70568395", "0.694903", "0.6930471", "0.68859094", "0.6753931", "0.66169304", "0.6603185", "0.6579087", "0.6525873", "0.6507001", "0.6477229", "0.6474859", "0.6425751", "0.64191926", "0.6407274...
0.7348207
3
This field represents space used by the aggregate including the aggregate's Snapshot reserve in bytes.
def fs_used_including_snapshot_reserve(self): return self._fs_used_including_snapshot_reserve
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fs_total_reserved_space(self):\n return self._fs_total_reserved_space", "def capacity_used(self):\n raise NotImplementedError()", "def bytes_used(self):\n return int(self.status[\"pgmap\"][\"bytes_used\"])", "def fs_size_used(self):\n return self._fs_size_used", "def get_spa...
[ "0.7311858", "0.68309844", "0.664259", "0.6617146", "0.66081816", "0.66023266", "0.66021866", "0.6558189", "0.6507855", "0.6472979", "0.6430022", "0.64208555", "0.6364673", "0.63083977", "0.6308299", "0.6308299", "0.6308299", "0.6308299", "0.6302829", "0.63014317", "0.6300755...
0.6747708
2
Convert a pytorch geometric dataset to gckn dataset
def convert_dataset(dataset, n_tags=None): if dataset is None: return dataset graph_list = [] for i, g in enumerate(dataset): new_g = S2VGraph(g, g.y) new_g.neighbors = get_adj_list(g) if n_tags is not None: new_g.node_features = F.one_hot(g.x.view(-1).long(), n_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gc_data(dataset, dirname, train_ratio=0.8):\n \n # Define path where dataset should be saved\n data_path = \"data/{}.pth\".format(dataset)\n\n # If already created, do not recreate\n if os.path.exists(data_path):\n data = torch.load(data_path)\n else:\n if dataset == 'syn6':\n ...
[ "0.654751", "0.5732393", "0.57198703", "0.5673252", "0.56613374", "0.5646728", "0.5629825", "0.5607446", "0.55946285", "0.5585697", "0.55554587", "0.54788715", "0.54736745", "0.5464334", "0.54574233", "0.5436929", "0.54280037", "0.54170096", "0.5412945", "0.53947353", "0.5380...
0.5220303
34
take pytorch geometric dataest as input
def apply_to(self, train_dset, test_dset=None, batch_size=64, n_tags=None): saved_pos_enc = self.load() if saved_pos_enc is not None: dset_len = len(train_dset) if test_dset is None else len(train_dset) + len(test_dset) if len(saved_pos_enc) != dset_len: raise Val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geglu(x: Tensor) ->Tensor:\n assert x.shape[-1] % 2 == 0\n a, b = x.chunk(2, dim=-1)\n return a * F.gelu(b)", "def gelu(x):\n cdf = 0.5 * (1.0 + torch.tanh(\n (np.sqrt(2 / np.pi) * (x + 0.044715 * np.power(x, 3)))))\n return x * cdf", "def gelu(x):\n cdf = 0.5 * (1.0 + torch.tanh(\n (...
[ "0.62357146", "0.61351407", "0.6089715", "0.5987402", "0.5977883", "0.5976598", "0.5976598", "0.5976598", "0.5976598", "0.5976598", "0.5976598", "0.5976598", "0.5976598", "0.597421", "0.59034044", "0.5888436", "0.58755225", "0.58755225", "0.5870501", "0.57885617", "0.578758",...
0.0
-1
Downmix to 2 channels if multichannel audio
def downmixWAV(self, wavf: str) -> None: # HACK: https://github.com/jiaaro/pydub/issues/129 # FIXME: a reliable method to get number of wav channels multichannel = True try: w = wave.open(wavf, 'rb') if w.getnchannels() < 3: multichannel = False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _augment_channelswap(audio):\n if audio.shape[0] == 2 and torch.FloatTensor(1).uniform_() < 0.5:\n return torch.flip(audio, [0])\n\n return audio", "def split_into_channels(audio):\n\tif AUDIO_CHANNELS == 1:\n\t\treturn [audio]\n\tif AUDIO_CHANNELS == 2:\n\t\treturn [audioop.tomono(audio, AUDIO_...
[ "0.66251373", "0.58017147", "0.57132083", "0.56815225", "0.56815225", "0.5676537", "0.5673752", "0.5620985", "0.55017495", "0.5484101", "0.53784776", "0.5284562", "0.5257859", "0.52494276", "0.5246769", "0.52426875", "0.521309", "0.5204684", "0.5174859", "0.5143285", "0.51371...
0.6062682
1
Entrypoint to encode a PCM WAV according to self.codec Calls the corresponding encoding flavour subroutine
def encode(self, wavf: str, dstf: str, cover: str, meta: TrackMeta) -> None: if self.downmix: self.downmixWAV(wavf) if self.codec == 'opus': self.encodeOpus(wavf, dstf, cover, meta) elif self.codec == 'flac': self.encodeFLAC(wavf, dstf, cover, meta) el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_audio(in_file, out_file):\r\n # construct the encoder\r\n autoencoder = keras.models.load_model(\"audio_autoencoder.model\")\r\n in_layer = keras.layers.Input(shape=(416, 1))\r\n encode = autoencoder.layers[1](in_layer)\r\n encode = autoencoder.layers[2](encode)\r\n encode = autoencode...
[ "0.65444165", "0.616003", "0.61182684", "0.6044659", "0.599945", "0.5975797", "0.59426254", "0.5871932", "0.584925", "0.58197874", "0.5721502", "0.57136923", "0.5708158", "0.57024765", "0.56833845", "0.5681794", "0.56796414", "0.5656293", "0.5639054", "0.5635989", "0.5626203"...
0.708651
0
Encodes a PCM WAV file to Opus format
def encodeOpus(self, wavf: str, dstf: str, cover: str, meta: TrackMeta) -> None: # TODO: bitrate 160/128 FNULL = open(os.devnull, 'w') args = ['opusenc', '--bitrate', '192', '--quiet'] if cover: args.append('--picture') args.append(cover) args.append(wavf)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_audio(in_file, out_file):\r\n # construct the encoder\r\n autoencoder = keras.models.load_model(\"audio_autoencoder.model\")\r\n in_layer = keras.layers.Input(shape=(416, 1))\r\n encode = autoencoder.layers[1](in_layer)\r\n encode = autoencoder.layers[2](encode)\r\n encode = autoencode...
[ "0.7447126", "0.6970458", "0.69213575", "0.673158", "0.663907", "0.6574715", "0.64782006", "0.6477646", "0.6452267", "0.63436055", "0.6342738", "0.632365", "0.6308248", "0.6288879", "0.628517", "0.6273824", "0.6239329", "0.6218261", "0.6209541", "0.6154164", "0.61016804", "...
0.69532764
2
Encodes a PCM WAV file to FLAC format
def encodeFLAC(self, wavf: str, dstf: str, cover: str, meta: TrackMeta) -> None: FNULL = open(os.devnull, 'w') args = ['flac', '-f', '--totally-silent', '--best'] if cover: args.append('--picture') args.append(cover) args.append('-o') args.append(dstf) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_flac(track_metadata):\n\tprint(\"---- Encoding\", track_metadata.file_name, \"to FLAC...\")\n\tnew_file_name = track_metadata.file_name + \".flac\"\n\tffmpeg(\"-i\", track_metadata.file_name, \"-c:a\", \"flac\", \"-compression_level\", \"12\", \"-lpc_passes\", \"8\", \"-lpc_type\", \"3\", \"-threads\", ...
[ "0.72776765", "0.6860318", "0.6540664", "0.6528014", "0.6487192", "0.6446292", "0.6383675", "0.6361182", "0.6282809", "0.6255544", "0.6238018", "0.6137223", "0.61305374", "0.6121943", "0.60995096", "0.609092", "0.60784394", "0.6054091", "0.5974038", "0.5963611", "0.59626454",...
0.7052307
1
Encodes a PCM WAV file to MPEG4 AAC format (using NeroAAC)
def encodeAAC(self, wavf: str, dstf: str, cover: str, meta: TrackMeta) -> None: FNULL = open(os.devnull, 'w') subprocess.call(['neroAacEnc', '-q', '0.5', '-if', wavf, '-of', dstf], stdout=FNULL, stderr=FNULL) FNULL.close() # tag AAC mm = TrackMeta(meta) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_audio(in_file, out_file):\r\n # construct the encoder\r\n autoencoder = keras.models.load_model(\"audio_autoencoder.model\")\r\n in_layer = keras.layers.Input(shape=(416, 1))\r\n encode = autoencoder.layers[1](in_layer)\r\n encode = autoencoder.layers[2](encode)\r\n encode = autoencode...
[ "0.7306032", "0.62807316", "0.6186692", "0.6184887", "0.61353177", "0.6118008", "0.60905915", "0.60306704", "0.6010781", "0.59966815", "0.5967336", "0.5942693", "0.59272087", "0.59113586", "0.5872926", "0.58028793", "0.57023853", "0.56894857", "0.5689196", "0.5650187", "0.562...
0.7470973
0
Encodes a PCM WAV file to MPEG1 Audio Layer 3 format
def encodeMP3(self, wavf: str, dstf: str, cover: str, meta: TrackMeta) -> None: FNULL = open(os.devnull, 'w') subprocess.call(['lame', '-V2', wavf, dstf], stdout=FNULL, stderr=FNULL) FNULL.close() # tag MP3 mm = TrackMeta(meta) mp3 = MP3(dstf, ID3=ID3) mp3["TIT2"]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_audio(in_file, out_file):\r\n # construct the encoder\r\n autoencoder = keras.models.load_model(\"audio_autoencoder.model\")\r\n in_layer = keras.layers.Input(shape=(416, 1))\r\n encode = autoencoder.layers[1](in_layer)\r\n encode = autoencoder.layers[2](encode)\r\n encode = autoencode...
[ "0.7180157", "0.67253464", "0.6287279", "0.62661546", "0.62112314", "0.6203485", "0.61516106", "0.60963863", "0.60483384", "0.60130453", "0.5990268", "0.5917148", "0.5906605", "0.58948284", "0.58849406", "0.58605796", "0.58453244", "0.5831902", "0.5786693", "0.5777332", "0.57...
0.655354
2
takes the outcomes and selected scenario set (decision variables), returns a single 'diversity' value for the scenario set.
def evaluate_diversity_single(indices, distances, weight=0.5): i, j = [e for e in zip(*itertools.combinations(indices, 2))] subset_distances = distances[i, j] minimum = np.min(subset_distances) mean = np.mean(subset_distances) diversity = (1 - weight) * minimum + weight * mean return [diversity...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_diversity(population):\n\t# average variance of each component\n\treturn np.average(np.var(population, axis = 0))\n\treturn np.average(np.std(population, axis = 0))\n\treturn np.average(np.std(population, axis = 0) / ((self.benchmarks.bound[1] - self.benchmarks.bound[0]) / 2))", "def diversity(\n ...
[ "0.65562975", "0.6465593", "0.5673692", "0.5498322", "0.53967047", "0.5292437", "0.5262143", "0.5250632", "0.52175653", "0.5182313", "0.5163027", "0.50862765", "0.507137", "0.50572085", "0.50517184", "0.50378966", "0.5029479", "0.499668", "0.49924362", "0.4977275", "0.4975866...
0.52010244
9
Get the given duration in seconds
def get_duration(days=0, hours=0, minutes=0, seconds=0, millis=0): duration = 0.0 duration += float(days) * 24 * 60 * 60 duration += float(hours) * 60 * 60 duration += float(minutes) * 60 duration += float(seconds) duration += millis / 1000.0 return duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seconds(duration):\n if not duration:\n return 0\n try:\n h, m, s = duration_parts(duration)\n return s\n except (ValueError, TypeError):\n return 0", "def duration_in_seconds(self):\n return self.get_data(\"duration_in_seconds\")", "def _duration_to_secs(duratio...
[ "0.8274603", "0.76853216", "0.76443124", "0.75087965", "0.7362068", "0.73546374", "0.7218812", "0.7170379", "0.71551794", "0.7144807", "0.713223", "0.7123354", "0.70880836", "0.708677", "0.7065162", "0.70577097", "0.70576304", "0.7033154", "0.7019381", "0.69986045", "0.699417...
0.0
-1
Check if we should still be running, if so, wait until it's time for the next tick.
def tick(self): next_tick = self.last_tick + self.seconds_per_tick while self.running: current_time = time() if current_time > next_tick: break sleep(self.sleep_duration) if not self.running: return False self.last_tic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_time():\n while rospy.Time().now().to_sec() == 0:\n pass", "def wait_for_time():\n while rospy.Time().now().to_sec() == 0:\n pass", "def wait_for_time():\n while rospy.Time().now().to_sec() == 0:\n pass", "def wait_for_time():\n while rospy.Time().now().to_sec() ==...
[ "0.7300542", "0.7300542", "0.7300542", "0.7289167", "0.7247361", "0.7039833", "0.6979855", "0.6862091", "0.6821541", "0.6780667", "0.674327", "0.6694194", "0.6670322", "0.6609794", "0.65913993", "0.6578846", "0.65357697", "0.6474358", "0.64478546", "0.643314", "0.6413789", ...
0.6896591
7
Dynamically load the module property as defined by the search parameter.
def load_from_module(search_definition): try: module_name, property_name = search_definition.split(":") except: raise ValueError( 'Search definition "{}" is not valid.'.format(search_definition) ) try: module = importlib.import_module(module_name) except Imp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_parameter(self):", "def import_JobProperties(self,module_name):\n try:\n if(module_name.count('.')==0):\n module=__import__(module_name,globals(),locals())\n elif(module_name.count('.')>0):\n module=__import__(module_name,globals(),locals(),\\\...
[ "0.5654104", "0.5592349", "0.5528449", "0.54257554", "0.5403773", "0.5367219", "0.53629297", "0.53102595", "0.5158309", "0.51294607", "0.5115421", "0.5083747", "0.5082948", "0.50689006", "0.5064725", "0.5059072", "0.50013876", "0.49670178", "0.49537078", "0.49127337", "0.4895...
0.6725258
0
Change the value in s to its binary representation.
def tobits(s): # Get the length of the input string length = len(s) # Create an empty list outputbits = [0] * length # Run the for loop for i in range(0, length): # Create an empty string stchar = '' # Run the loop for each character for char in s[i]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def s2b (s):\n return s.encode()", "def s2b(s):\n return s.encode('utf-8')", "def to_binary_string(x):\n return \"{0:b}\".format(x)", "def repr_as_binary(value):\n b = bin(value)[2:]\n return b.zfill(len(b) + -len(b) % 8)", "def binstr(x):\n xs = binary_repr(x)\n\n outstr = xs;...
[ "0.7148659", "0.6838792", "0.66999453", "0.6415657", "0.6405314", "0.62653095", "0.59890795", "0.5958184", "0.5947648", "0.5778404", "0.57623476", "0.57416505", "0.5738603", "0.57354444", "0.5729073", "0.572353", "0.572353", "0.5695623", "0.56772715", "0.5676499", "0.5673497"...
0.63373107
5
change the value in bits to string.
def frombits(bits): # Create an empty string outputstring = '' # Get the length of bits length = len(bits) # Run the for loop for i in range(0, int(length / 8)): # Get the character for each 8 bits temp = chr(int(bits[8 * i:8 * i + 8], 2)) # Append each character to a str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_bit_string(value):\n\n return \"{0:b}\".format(value).zfill(8)", "def bits2string(b=None):\n return ''.join([chr(int(x, 2)) for x in b])", "def valueToString():", "def to_string(self, name, value):\r\n \r\n return str(value)", "def make_bitstring(num):\n return bin(num)[2:]"...
[ "0.7182922", "0.70788354", "0.6883576", "0.68563175", "0.6700194", "0.6655907", "0.65955603", "0.6521708", "0.6513384", "0.6439261", "0.6436823", "0.6392127", "0.63915265", "0.6379998", "0.63605124", "0.6318937", "0.6283902", "0.6192956", "0.61704415", "0.6163797", "0.6146986...
0.59056246
45
Append padding to message in order to become multiple of 16 in order to fit in AES input
def padding(message): # Convert the string to bits by calling the tobits function mbits = tobits(message) # Get the length of bits length = len(mbits) # Calculate the strengthening vector length strengthmessage = (bin(int(length))[2:]).zfill(64 * ((len(bin(int(length))[2:]) + 63) // 64)) #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_padding(input_str):\r\n padding_len = AES.block_size - len(input_str) % AES.block_size\r\n return input_str + padding_len * chr(padding_len)", "def pad(data):\r\n bytes_to_pad = AES.block_size - len(data) % AES.block_size\r\n return data + (bytes_to_pad * chr(bytes_to_pad))", "def ...
[ "0.75792027", "0.74822587", "0.7470095", "0.739368", "0.7360763", "0.71821815", "0.67783034", "0.66801685", "0.6679499", "0.6643136", "0.6631054", "0.6626734", "0.6618439", "0.66098475", "0.6549192", "0.6508206", "0.6430022", "0.63941205", "0.63530207", "0.6349969", "0.634504...
0.7016211
6
This function computes the MAC of message using key. The MAC function is CBCMAC with AES and both single1 padding and length strengthening provided by the padding function. key must be convertible to bytes of length 16 messuge must be convertible to bytes type
def CBCMACbasedOnAES(message, key): # Convert the message into bytes message1 = bytes(message) # Convert the key into bytes key1 = bytes(key) # Create the AES object aes_obj = AES.new(key1, AES.MODE_CBC, iv) # Encrypt the message MAC = aes_obj.encrypt(message1) # Return the MAC of ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cbc_mac(key, data):\n engine = AES.new(key, AES.MODE_CBC, get_zero_vector(16))\n return engine.encrypt(data)[-16:]", "def make_hmac(message, key):\n h = HMAC.new(key)\n h.update(message)\n return h.hexdigest()", "def get_cipher_key(key):\n k = (\n key[0] ^ key[4],\n ...
[ "0.7086036", "0.611308", "0.5901191", "0.5669914", "0.56285095", "0.5557149", "0.5410308", "0.5361496", "0.5354697", "0.53063726", "0.5291547", "0.52718997", "0.52700454", "0.5262614", "0.5262613", "0.5235734", "0.5188047", "0.5168812", "0.5162046", "0.51358014", "0.5132436",...
0.80590457
0
Split the main histogram file into a number of files based on the xaxis of the histograms. You can put all met_0j histograms into a single file and all met_1j1b histograms into a single file.
def split4fit(infile, histogram_list=['met_0j','met_1pj']): import ROOT outpfx = infile.split('.root')[0] if '/' in outpfx: outpfx = outpfx.split('/')[-1] infile = ROOT.TFile(infile,'read') lok = [str(o.GetName()) for o in infile.GetListOfKeys()] def make_a_file(hist_name): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_histograms(self, folder_name):\n histograms_folder_name = folder_name + '_histograms'\n\n try:\n print(\"Making dir \" + str(histograms_folder_name) + \" for histograms\")\n os.mkdir(histograms_folder_name)\n except OSError:\n print(\"Folder exists, hav...
[ "0.5699574", "0.5582589", "0.5546733", "0.55327415", "0.54630715", "0.54044586", "0.53796023", "0.5354796", "0.5354093", "0.53540707", "0.5308832", "0.5264176", "0.52597815", "0.52456474", "0.5224068", "0.51899284", "0.51747006", "0.51713526", "0.5169178", "0.5167327", "0.516...
0.70357597
0
Creates an ordered list of archers with their score, hits and golds from the excel file containing all scores, named "OutdoorScores.xlsx"
def CategoryScore(Category): Category = pd.read_excel('OutdoorScores.xlsx', Category , usecols=[0,1,2,3,4]) ResultCategory = Category.sort_values(['Score','Golds','Hits'], ascending=[False,False,False],na_position='last') ResultCategory = Resu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_leaders():\n wb = openpyxl.load_workbook(filename='leaderboard.xlsx')\n sheet = wb['Sheet1']\n names = []\n ascores = []\n i = 1\n for j in range(10):\n names.append(str(sheet.cell(row=i, column=1).value))\n ascores.append(int(sheet.cell(row=i, column=2).value))\n i...
[ "0.6795039", "0.6045968", "0.5869129", "0.5824975", "0.5738895", "0.5729558", "0.5721775", "0.5709046", "0.5646328", "0.5606915", "0.55951196", "0.5586269", "0.5577598", "0.548148", "0.5480782", "0.54732007", "0.5448698", "0.5438781", "0.5431352", "0.5423162", "0.5350822", ...
0.48932105
91
Function to print individual scores per category
def PrintCategoryScore(Cat): print() print("########## Individual Category Results ##########") for i in range(len(Cat)): # prints out the results per category print() print(Cat[i]) print(CategoryScore(Cat[i])) print() return print("----- End of Individuals Categor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_scores(result_collector):\n # print(\"\\n# Metric: Cohen's kappa\")\n # result_collector.set_metric(['k_cohen', 'k'])\n # result_collector.print_all_results()\n print(\"\\n# Metric: Macro avg. F1\")\n result_collector.set_metric([\"macro_avg\", \"fscore\"])\n # result_collector.print_al...
[ "0.67260253", "0.6665418", "0.66344786", "0.6530227", "0.65061975", "0.6398446", "0.62773705", "0.62684315", "0.6259877", "0.6157813", "0.6103413", "0.6028164", "0.5972317", "0.5953665", "0.59463376", "0.5870147", "0.57962006", "0.5781991", "0.5767299", "0.57437664", "0.57170...
0.82049257
0
Combines all scores from all categories, except compound categories, such that an experienced team can be created.
def Combined_Non_Compound_Results(level): CombinedResults = pd.DataFrame({},columns=['Name','Club','Score', 'Golds', 'Hits']) # Initial empty dataframe to append in to for i in level: CombinedResults = CombinedResults.append(CategoryScore(i)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_all_evaluation(self, tag_bundle_set):\n categories_list = []\n for num, category in enumerate(self.categories):\n (is_matching_category, op_result_meta_info) = category.apply(tag_bundle_set)\n if is_matching_category:\n categories_list.append(\n ...
[ "0.6232284", "0.5805466", "0.56819975", "0.5554579", "0.55330455", "0.5505344", "0.53095824", "0.52563643", "0.5238515", "0.51255673", "0.5124239", "0.50875473", "0.50687027", "0.50635606", "0.50389135", "0.501613", "0.50091064", "0.49548933", "0.49239996", "0.4914003", "0.49...
0.5833497
1
"level" refers to either NovCategories or AllCategories, i.e. this function returns either novice or experienced teams, where experienced teams can contain novices.
def TeamScores(level,team_N): groupresults = Combined_Non_Compound_Results(level).groupby('Club') # groups clubs together in a big list just for NMR # will need to generalise for all categories LoR = [ frame for LoRs, frame in groupresults ] TeamTable = pd.DataFrame({},columns=['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_level(self, level):\n return", "def getLevel(self, level):\n mingroup = None\n groups = self.console.storage.getGroups()\n\n for x in groups:\n\n if x.level < level:\n continue\n\n if mingroup is None:\n mingroup = x\n ...
[ "0.6421769", "0.6160101", "0.579061", "0.57043594", "0.5589996", "0.5533693", "0.54887515", "0.54760265", "0.5471949", "0.5441435", "0.541128", "0.540279", "0.53987706", "0.5366603", "0.5304298", "0.52911276", "0.5269117", "0.5265375", "0.52508336", "0.5245916", "0.52325886",...
0.0
-1
Initializer that takes in a list of number of neurons in each layer randn(m, n) returns m x n matrix of random numbers from a normal distribution zip(a, b) returns list of tuples with values from a, b
def __init__(self, sizes: list): self.num_layers = len(sizes) self.sizes = sizes self.biases = [np.random.randn(y, 1) for y in sizes[1:]] self.weights = [np.random.randn(y, x) for x, y in zip(sizes[:-1], sizes[1:])]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_random_matrix(n):\n return [[random.randint(1, 50) for i in range(n)] for j in range(n)]", "def init_random_params(scale, layer_sizes, rs=npr.RandomState(0)):\n return [(scale * rs.randn(m, n), # weight matrix\n scale * rs.randn(n)) # bias vector\n for m, n in zip...
[ "0.6493381", "0.6480992", "0.6416156", "0.6342152", "0.62880176", "0.6283137", "0.6260111", "0.6217703", "0.6192845", "0.6174658", "0.6168335", "0.6104254", "0.60990536", "0.60782176", "0.60746795", "0.6063433", "0.60263085", "0.60250354", "0.59839183", "0.59801257", "0.59784...
0.55047
80
Return the output of the network if is input
def feed_forward(self, a): for b, w in zip(self.biases, self.weights): a = sigmoid(np.dot(w, a) + b) return a
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input(self):\n connected_node = self.get_connected_node()\n if connected_node:\n #it is not possible to connect to an input\n return connected_node.output()\n return None", "def pred_from_net_output(self, net_output: ALL_NET_OUTPUT) -> torch.Tensor:\n raise N...
[ "0.7112945", "0.6837349", "0.6812708", "0.6740701", "0.6722642", "0.657854", "0.6458213", "0.6381645", "0.63765216", "0.6358677", "0.625985", "0.6219313", "0.6201402", "0.61769295", "0.615385", "0.6140945", "0.61316967", "0.60971904", "0.60626006", "0.6061749", "0.606071", ...
0.0
-1
Train the neural net using minibatch stochastic gradient descent If is supplied, then the program will evaluate the network after each epoch training_data is a list of tuples (x, y) with x as input and y as expected output
def sgd(self, training_data: list, num_epochs: int, mini_batch_size: int, eta: float, test_data=None): n = len(training_data) for j in range(num_epochs): random.shuffle(training_data) mini_batches = [training_data[k: k + mini_batch_size] for k in range(0, n, mini_batch_size)] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def miniBatchStochasticGD(self, x, y, batchSize, epochs):\n print(\"Training using stochastic minibatch gradient descent\")\n epoch = 0\n fullSetSize = x.shape[0]\n #output training progress ten times in run\n outputChunk = int ( epochs / 10 )\n\n while epoch <= epochs:\n ...
[ "0.72270536", "0.71475214", "0.7036032", "0.7021487", "0.69404864", "0.69394267", "0.69327646", "0.69167167", "0.6907639", "0.6885638", "0.68781966", "0.6866682", "0.68590695", "0.68407106", "0.68397886", "0.6797864", "0.6782636", "0.67748296", "0.6770139", "0.676445", "0.676...
0.0
-1
Update the biases and weights according to the minibatch
def update_mini_batch(self, mini_batch: list, eta: float): # Create a set of biases and weights that are zeros nabla_b = [np.zeros(b.shape) for b in self.biases] nabla_w = [np.zeros(w.shape) for w in self.weights] # Update gradients for biases and weights for x, y in mini_batch:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_weights(self):\n\t\tpass", "def update_weights(self):\n self._weights = self._weights + self.update_weights_value\n self.weights_clipping()", "def update_mini_batch2_4(self, mini_batch, eta):\r\n nabla_b = [np.zeros(b.shape) for b in self.biases]\r\n nabla_w = [np.zeros(w...
[ "0.7421371", "0.6991882", "0.6848822", "0.67945004", "0.67168677", "0.66101074", "0.65153664", "0.65024835", "0.64673924", "0.64332306", "0.64307845", "0.63667667", "0.63380885", "0.6334833", "0.6333449", "0.63224673", "0.6308737", "0.63058054", "0.6305587", "0.6304924", "0.6...
0.58211875
100
Return a tuple (nabla_b, nabla_w) representing the gradient for the cost function C_x Each of and are lists of NumPy arrays similar in structure to and
def backprop(self, x, y): nabla_b = [np.zeros(b.shape) for b in self.biases] nabla_w = [np.zeros(w.shape) for w in self.weights] # Feed forward activation = x activations = [x] zs = [] # Store the weighted inputs of each layer (z before activation function) for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_gradients(self):\n wlist = self._neural_net.weights()\n blist = self._neural_net.biases()\n\n nmatrices = len(wlist)\n weight_grad = []\n bias_grad = []\n\n cost_function = self._cost_function\n weight_der = WeightDerivative(neural_net=self._neural_net,\...
[ "0.6407299", "0.6327713", "0.6275338", "0.6226583", "0.6159513", "0.60856426", "0.6059724", "0.6057005", "0.60185087", "0.6004246", "0.5938753", "0.5938481", "0.5900218", "0.58863527", "0.5880659", "0.5858331", "0.57814264", "0.5776528", "0.5766199", "0.5753891", "0.5751687",...
0.0
-1
Return the number of test inputs for which the neural network outputs the correct result. Note that the neural network's output is assumed to be the index of whichever neuron in the final layer has the highest activation.
def evaluate(self, test_data): test_results = [(np.argmax(self.feed_forward(x)), y) for (x, y) in test_data] return sum(int(x == y) for (x, y) in test_results)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_network(neural_network, test_data):\n total_trials = 0\n correct_trials = 0\n output_values = [np.argmax(neural_network.calculate_output(vector[1])) for vector in test_data]\n expected_values = list(zip(*test_data))[0]\n for expected, recieved in zip(expected_values,output_values):\n ...
[ "0.71643096", "0.678337", "0.66984856", "0.6695219", "0.6695219", "0.6681218", "0.6619715", "0.66186917", "0.6527112", "0.6512901", "0.6510943", "0.6478449", "0.64484787", "0.6436919", "0.6436919", "0.6424878", "0.6382965", "0.6375347", "0.6356472", "0.634797", "0.6315814", ...
0.621531
24
Return the vector of partial derivatives \partial C_x / \partial a for the output activations Based on the quadratic cost function C(x) = 1/(2n) (y a^L(x))^2 where x is input y is expected output a^L is the actual output
def cost_derivative(self, output_activations, y): return (output_activations-y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cost_derivative(self, output_activations, y):\r\n return (output_activations-y)", "def cost_derivative(output_activations, y):\n return (output_activations - y)", "def cost_derivative(self, output_activations, y):\n\t\treturn (output_activations - y)", "def deriv_costFunction(self, x, y...
[ "0.63106906", "0.6288777", "0.6248431", "0.61870795", "0.61130613", "0.60892075", "0.6084112", "0.6036914", "0.60203856", "0.59552675", "0.5933606", "0.5922783", "0.59008473", "0.5899504", "0.58983827", "0.5898196", "0.5894403", "0.58335376", "0.57893485", "0.5781006", "0.577...
0.62181246
6
Derivative of the sigmoid function.
def sigmoid_prime(z): return sigmoid(z)*(1-sigmoid(z))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid_derivative(x):\n return x * (1-x)", "def sigmoid_derivative(x):\n return x * (1.0 - x)", "def sigmoid_derivative(x):\n\n return sigmoid(x) * (1 - sigmoid(x))", "def derivative_sigmoid(x):\n return x * (1 - x)", "def derivative_sigmoid(x):\n return x * (1 - x)", "def sigmoid_der...
[ "0.84754366", "0.8450928", "0.8396931", "0.83485264", "0.83485264", "0.8298343", "0.80539966", "0.7753385", "0.77070266", "0.7498153", "0.7464916", "0.7454039", "0.7401582", "0.7385017", "0.73829913", "0.7346935", "0.7321687", "0.73094004", "0.7192053", "0.7113881", "0.709236...
0.0
-1
TM_fluid returns the 2x2 Transfer Matrix of a fluid layer
def TM_fluid(layer, kx, om): h = layer.d rho = layer.medium.rho K = layer.medium.K k = om*np.sqrt(rho/K) ky = np.sqrt(k**2-kx**2) T = np.zeros((2, 2), dtype=complex) T[0, 0] = np.cos(ky*h) T[1, 0] = (om**2*rho/ky)*np.sin(ky*h) T[0, 1] = -(ky/(om**2*rho))*np.sin(ky*h) T[1, 1] = n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fluid_func(self):\n residual = []\n for fluid, x in self.inl[0].fluid.val.items():\n res = x * self.inl[0].m.val_SI\n for o in self.outl:\n res -= o.fluid.val[fluid] * o.m.val_SI\n residual += [res]\n return residual", "def fluid_func(self)...
[ "0.5768485", "0.56176883", "0.5443617", "0.5435858", "0.5388646", "0.53567904", "0.53567904", "0.53390956", "0.52819616", "0.52702206", "0.52634484", "0.5213695", "0.5176987", "0.51402587", "0.50595313", "0.50586605", "0.5050682", "0.5046748", "0.5044931", "0.49993876", "0.49...
0.6433278
0