code
stringlengths
101
5.91M
def CalculateCompositionSolventAccessibility(ProteinSequence): result = CalculateComposition(ProteinSequence, _SolventAccessibility, '_SolventAccessibility') return result
def get_datasets(cfg, args): tr_dataset = DeformHandlesDataset(cfg, cfg.train, train=True) te_dataset = DeformHandlesDataset(cfg, cfg.val, train=False) return (tr_dataset, te_dataset)
def parse_doc(doc, disable, keep_whitespace=False): disable = ({'ner', 'parser', 'tagger', 'lemmatizer'} if (not disable) else disable) for (position, sent) in enumerate(doc.sents): parts = defaultdict(list) for (i, token) in enumerate(sent): text = str(sent.text) parts['newlines'] = [m.span()[0] for m in re.finditer('(\\n)', text)] if ((not keep_whitespace) and (not token.text.strip())): continue parts['words'].append(token.text) parts['abs_char_offsets'].append(token.idx) if ('lemmatizer' not in disable): parts['lemmas'].append(token.lemma_) if ('tagger' not in disable): parts['pos_tags'].append(token.tag_) if ('ner' not in disable): parts['ner_tags'].append((token.ent_type_ if token.ent_type_ else 'O')) if ('parser' not in disable): head_idx = (0 if (token.head is token) else ((token.head.i - sent[0].i) + 1)) parts['dep_parents'].append(head_idx) parts['dep_labels'].append(token.dep_) if (not parts['words']): continue parts['i'] = position (yield parts)
class ContextualBandit(object): def __init__(self, context_dim, num_actions): self._context_dim = context_dim self._num_actions = num_actions def feed_data(self, data): if (data.shape[1] != (self.context_dim + self.num_actions)): raise ValueError('Data dimensions do not match.') self._number_contexts = data.shape[0] self.data = data self.order = range(self.number_contexts) def reset(self): self.order = np.random.permutation(self.number_contexts) def context(self, number): return self.data[self.order[number]][:self.context_dim] def reward(self, number, action): return self.data[self.order[number]][(self.context_dim + action)] def optimal(self, number): return np.argmax(self.data[self.order[number]][self.context_dim:]) def context_dim(self): return self._context_dim def num_actions(self): return self._num_actions def number_contexts(self): return self._number_contexts
def benchmark(repetitions, timeout): for fileName in os.listdir(PROJECT_CONFIG['build_dir']): try: conf = Configuration.get_conf(fileName) except ValueError: continue confStr = conf.to_string() folderName = conf.benchmark_folder() kernelFolder = os.path.join(PROJECT_CONFIG['build_dir'], fileName) kernelString = PROJECT_CONFIG['kernel_file'] kernelPath = os.path.join(kernelFolder, (kernelString + '.xclbin')) if (not os.path.exists(kernelPath)): continue benchmarkFile = 'benchmark.csv' print('Running {}...'.format(confStr)) if (run_process(['make'], kernelFolder, pipe=False) != 0): raise Exception((confStr + ': software build failed.')) repsDone = 0 timeouts = 0 with open(benchmarkFile, 'a') as outFile: outFile.write((conf.csv_header() + ',time,performance,power,power_efficiency\n')) while (repsDone < repetitions): time.sleep(0.5) profilePath = os.path.join(('benchmark_' + str(datetime.datetime.now()).replace(' ', '_').replace(':', '-'))) print('Running iteration {} / {}...'.format((repsDone + 1), repetitions)) cmd = ['./RunHardware.exe'] if ('DYNAMIC_SIZES=ON' in open(os.path.join(kernelFolder, 'configure.sh')).read()): cmd += [str(conf.size_n), str(conf.size_k), str(conf.size_m)] cmd += ['hw', 'off'] try: ret = run_process(cmd, kernelFolder, pipe=True, logPath=profilePath, timeout=timeout) except sp.TimeoutExpired as err: timeouts += 1 if (timeouts > 10): print((('\n' + confStr) + ': exceeded maximum number of timeouts. Skipping.')) break else: print((confStr + ': timeout occurred. Retrying...')) continue if (ret != 0): raise Exception((confStr + ': kernel execution failed.')) repsDone += 1 timeouts = 0
def get_parser(): parser = ArgumentParser(description='NN Explainer', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add('-c', '--config', is_config_file=True, help='config file path') parser.add('--arg_log', default=False, type=str2bool, help='save arguments to config file') parser.add_argument('--dataset', choices=['VOC', 'COCO', 'CUB'], default='VOC', type=str, help='which dataset to use') parser.add_argument('--data_base_path', default='../datasets/', type=str, help='Base bath of the datasets. Should contain subdirectories with the different datasets.') parser.add_argument('--train_batch_size', default=16, type=int, help='batch size used for training') parser.add_argument('--val_batch_size', default=16, type=int, help='batch size used for validation') parser.add_argument('--test_batch_size', default=16, type=int, help='batch size used for testing') parser.add_argument('--use_data_augmentation', default=False, type=str2bool, help='set to true to enable data augmentation on training images') parser.add_argument('--seed', default=42, type=int, help='seed for all random number generators in pytorch, numpy, and python.random') parser.add_argument('--use_tensorboard_logger', default=False, type=str2bool, help='whether to use tensorboard') parser.add_argument('--checkpoint_callback', default=True, type=str2bool, help='if true, trained model will be automatically saved') parser.add_argument('--early_stop_min_delta', default=0.001, type=float, help='threshold for early stopping condition') parser.add_argument('--early_stop_patience', default=5, type=int, help='patience for early stopping to trigger') parser.add_argument('--train_model', default=True, type=str2bool, help='If True, specified model will be trained. If False, model will be tested.') parser.add_argument('--use_imagenet_pretraining', default=True, type=str2bool, help='If True, classifiers use a pretrained backbone from ImageNet pretraining') parser.add_argument('--fix_classifier_backbone', default=True, type=str2bool, help='Whether to fix the wait for the classifiers backbone') parser.add_argument('--fix_classifier', default=True, type=str2bool, help='If True, classifier is frozen. Strongly recommended for Explainer training.') parser.add_argument('--model_to_train', choices=['explainer', 'classifier', 'fcnn', 'rtsal_explainer'], default='explainer', type=str, help='which model architecture should be used for training or testing') parser.add_argument('--classifier_type', choices=['vgg16', 'resnet50'], default='vgg16', type=str, help='type of classifier architecture to use') parser.add_argument('--explainer_classifier_checkpoint', default=None, type=str, help='Path to the .ckpt file that contains the weights of a pretrained explainer. Also contains the weights for the associated classifier.') parser.add_argument('--classifier_checkpoint', default=None, type=str, help='Path to the .ckpt file that contains the weights of a pretrained classifier.') parser.add_argument('--fcnn_checkpoint', default=None, type=str, help='Path to the .ckpt file that contains the weights of a pretrained self-explainer.') parser.add_argument('--learning_rate', default=1e-05, type=float, help='learning rate used by the Adam optimizer') parser.add_argument('--use_mask_variation_loss', default=True, type=str2bool, help='whether to use variation loss on the mask.') parser.add_argument('--use_mask_area_loss', default=True, type=str2bool, help='whether to use area loss on the mask.') parser.add_argument('--use_mask_coherency_loss', default=True, type=str2bool, help='whether to use mask coherency loss (only for self-explainer architecture)') parser.add_argument('--entropy_regularizer', default=1.0, type=float, help='loss weighting term for entropy loss') parser.add_argument('--mask_variation_regularizer', default=1.0, type=float, help='loss weighting term for mask variation loss') parser.add_argument('--mask_area_constraint_regularizer', default=1.0, type=float, help='loss weighting term for overall mask area constraint (currently not used!)') parser.add_argument('--mask_total_area_regularizer', default=0.1, type=float, help='loss weighting term for the total area loss') parser.add_argument('--ncmask_total_area_regularizer', default=0.3, type=float, help='loss weighting term for the area constraints for the individual class segmentation masks') parser.add_argument('--target_mask_min_area', default=0.05, type=float, help='minimum area for the overall mask area constraint (currently not used!)') parser.add_argument('--target_mask_max_area', default=0.5, type=float, help='maximum area for the overall mask area constraint (currently not used!)') parser.add_argument('--class_mask_min_area', default=0.05, type=float, help='minimum area for the area constraints for the individual class segmentation masks') parser.add_argument('--class_mask_max_area', default=0.3, type=float, help='maximum area for the area constraints for the individual class segmentation masks') parser.add_argument('--show_images', default=False, type=str2bool, help='If true, displays images and corresponding masked images during testing. Requires testing batch size to be 1.') parser.add_argument('--show_all_class_masks', default=False, type=str2bool, help='If true, displays individual class masks during testing. Requires VOC dataset. Requires testing batch size to be 1.') parser.add_argument('--show_max_activation_for_class_id', default=None, type=int, help='If true, highlights point of maximum activation for given class id. Requires testing batch size to be 1.') parser.add_argument('--save_masks', default=False, type=str2bool, help='If true, masks are saved to location specified by save_path (see below)') parser.add_argument('--save_masked_images', default=False, type=str2bool, help='If true, masked images are saved to location specified by save_path (see below)') parser.add_argument('--save_all_class_masks', default=False, type=str2bool, help='Unused.') parser.add_argument('--save_path', default='./results/', type=str, help='Path to where masks and/or masked images are saved if corresponding options are set to true.') parser.add_argument('--metrics_threshold', default=(- 1.0), type=float, help='Threshold for logit to count as positive vs. negative prediction. Use -1.0 for Explainer and 0.0 for classifier.') return parser
def get_eval_instances(handles, listener=False): insts = [(Instance(input=name, output=tuple(color)) if listener else Instance(input=tuple(color), output=name)) for (name, handle) in handles.iteritems() for color in munroecorpus.open_datafile(handle)] rng.shuffle(insts) return insts
def map_utt_doc(conv, wiki): (document, utterances) = ([], []) prev_uid = None for utt in conv: sec_idx = utt['docIdx'] sec = wiki[sec_idx] curr_text = utt['text'].strip('\n').strip('\t').lower() curr_uid = utt['uid'] if (prev_uid == None): prev_uid = curr_uid document.append(sec) elif (curr_uid == prev_uid): prev_utt = utterances.pop((- 1)) curr_text = ((prev_utt + ' ') + curr_text) else: prev_uid = curr_uid document.append(sec) utterances.append(curr_text) return (document, utterances)
def get_models(keyword, softwares=None): if (softwares is None): softwares = ['obj'] per_page = 100 (model_names, images, total_models) = search(keyword, per_page=per_page, softwares=softwares) insert_search_log(keyword, total_models, softwares) for i in tqdm(range((total_models // per_page))): (model_name, image, _) = search(keyword, page=(i + 2), softwares=softwares) model_names += model_name images += image print(f'{total_models} models found.') return (model_names, images)
class Contrast(BaseAugmentation): def _augment(self, img): v = (float_parameter(self.level, 1.8) + 0.1) return ImageEnhance.Contrast(img).enhance(v)
def __getattr__(name): return _sub_module_deprecation(sub_package='sparse.linalg', module='interface', private_modules=['_interface'], all=__all__, attribute=name)
class _Aggregation(enum.Enum): NONE = 0 MAX = 1 MIN = 2 COUNT = 3 SUM = 4 AVERAGE = 5
_dispatch def ihfftn(x, s=None, axes=None, norm=None, overwrite_x=False, workers=None): return (Dispatchable(x, np.ndarray),)
def save_obj(f, verts, faces, decimal_places: Optional[int]=None, verts_uvs: Optional[list]=None, faces_uvs: Optional[list]=None, texture_map: Optional[list]=None): use_texture = ((verts_uvs is not None) and (texture_map is not None) and (faces_uvs is not None)) if use_texture: output_path = pathlib.Path(f) obj_header = '\nmtllib {0}.mtl\nusemtl mesh\n\n'.format(output_path.stem) if (len(verts) and (not ((verts.dim() == 2) and (verts.size(1) == 3)))): message = "Argument 'verts' should either be empty or of shape (num_verts, 3)." raise ValueError(message) if (len(faces) and (not ((faces.dim() == 2) and (faces.size(1) == 3)))): message = "Argument 'faces' should either be empty or of shape (num_faces, 3)." raise ValueError(message) new_f = False if isinstance(f, str): new_f = True f = open(f, 'w') elif isinstance(f, pathlib.Path): new_f = True f = f.open('w') try: if use_texture: f.write(obj_header) _save(f, verts, faces, decimal_places, verts_uvs, faces_uvs) finally: if new_f: f.close() new_f = False if use_texture: try: transforms.ToPILImage()(texture_map.squeeze().cpu().permute(2, 0, 1)).save((output_path.parent / (output_path.stem + '.png'))) f_mtl = open((output_path.parent / (output_path.stem + '.mtl')), 'w') new_f = True lines = f'''newmtl mesh map_Kd {output_path.stem}.png # Test colors Ka 1.000 1.000 1.000 # white Kd 1.000 1.000 1.000 # white Ks 0.000 0.000 0.000 # black Ns 10.0 ''' f_mtl.write(lines) finally: if new_f: f_mtl.close()
class FakeExpression(): def __init__(self, operands, operator): self._operands = operands self._operator = operator def __repr__(self): return ('FakeExpression(%r, %r)' % (self._operands, self._operator)) def pyobject(self): raise TypeError('self must be a numeric expression') def operands(self): return self._operands def __getitem__(self, i): return self._operands[i] def operator(self): return self._operator def _fast_callable_(self, etb): return fast_callable(self, etb)
class AdjointFdfdSimulation(): def __init__(self, sim: FdfdSimulation) -> None: self.sim = sim self.cache = ([None] * len(sim.cache)) self.lock = threading.Lock() def simulate(self, z: np.ndarray, J: np.ndarray) -> np.ndarray: with self.lock: electric_fields = None for cache_index in range(len(self.cache)): cache_item = self.cache[cache_index] if (cache_item is None): continue (cache_z, cache_J, cache_fields) = cache_item if (np.array_equal(z, cache_z) and np.array_equal(J, cache_J)): electric_fields = cache_fields del self.cache[cache_index] break if (electric_fields is None): electric_fields = self._run_solver(z, J) del self.cache[0] self.cache.append((z, J, electric_fields)) return electric_fields def _run_solver(self, z: np.ndarray, J: np.ndarray) -> np.ndarray: dxes = [[np.conj(dx) for dx in grid] for grid in self.sim.dxes] (spx, spy, spz) = np.meshgrid(dxes[1][0], dxes[1][1], dxes[1][2], indexing='ij') (sdx, sdy, sdz) = np.meshgrid(dxes[0][0], dxes[0][1], dxes[0][2], indexing='ij') mult = np.multiply s = [mult(mult(sdx, spy), spz), mult(mult(spx, sdy), spz), mult(mult(spx, spy), sdz)] new_J = np.copy(fdfd_tools.unvec(J, self.sim.dims)) for k in range(3): new_J[k] /= np.conj(s[k]) new_J = fdfd_tools.vec(new_J) mu = None if (self.sim.mu is not None): mu = np.conj(fdfd_tools.vec(self.sim.mu)) sim_args = {'omega': np.conj(self.sim.omega), 'dxes': dxes, 'epsilon': np.conj(self.sim.get_epsilon(z)), 'mu': mu, 'J': new_J, 'pec': fdfd_tools.vec(self.sim.pec), 'pmc': fdfd_tools.vec(self.sim.pmc), 'bloch_vec': self.sim.bloch_vec} efields = self.sim.solver.solve(**sim_args) efields = fdfd_tools.unvec(efields, self.sim.dims) for i in range(3): efields[i] = np.multiply(efields[i], np.conj(s[i])) efields = fdfd_tools.vec(efields) return efields
def residual_block(input, output_shape, is_train, info=False, k=3, s=1, name='residual', activation_fn=lrelu, batch_norm=True): with tf.variable_scope(name): with tf.variable_scope('res1'): _ = conv2d(input, output_shape, is_train, k_h=k, k_w=k, s=s, activation_fn=activation_fn, batch_norm=batch_norm) with tf.variable_scope('res2'): _ = conv2d(input, output_shape, is_train, k_h=k, k_w=k, s=s, activation_fn=None, batch_norm=batch_norm) _ = activation_fn((_ + input)) if info: log.info('{} {}'.format(name, _)) return _
def extract(filename, node, prefix): if (not ((node.location.file is None) or os.path.samefile(d(node.location.file.name), filename))): return 0 if (node.kind in RECURSE_LIST): sub_prefix = prefix if (node.kind != CursorKind.TRANSLATION_UNIT): if (len(sub_prefix) > 0): sub_prefix += '_' sub_prefix += d(node.spelling) for i in node.get_children(): extract(filename, i, sub_prefix) if (node.kind in PRINT_LIST): comment = (d(node.raw_comment) if (node.raw_comment is not None) else '') comment = process_comment(comment) sub_prefix = prefix if (len(sub_prefix) > 0): sub_prefix += '_' if (len(node.spelling) > 0): name = sanitize_name((sub_prefix + d(node.spelling))) global output output.append((name, filename, comment))
class NetGradientChecker(object): def CompareNets(nets, outputs, outputs_with_grad_ids, inputs_with_grads, input_values=None, threshold=1e-07, print_net_images=False): def _get_output_with_grad_names(net_outputs): return [net_outputs[i] for i in outputs_with_grad_ids] if print_net_images: for (i, net) in enumerate(nets): png = net_drawer.GetPydotGraph(net).create_png() with open(((('caffe2_net_forward_' + str(i)) + net.Name()) + '.png'), 'wb') as f: f.write(png) results = [_get_grad(net, net_outputs, _get_output_with_grad_names(net_outputs), input_values, inputs_with_grads) for (net, net_outputs) in zip(nets, outputs)] if print_net_images: (_, _, backward_nets) = zip(*results) for (i, net) in enumerate(backward_nets): png = net_drawer.GetPydotGraph(net).create_png() with open(((('caffe2_net_' + str(i)) + net.Name()) + '.png'), 'wb') as f: f.write(png) (first_net_results, first_net_grads, _) = results[0] for (net_results, net_grads, _) in results[1:]: assert (len(net_results) == len(first_net_results)) for (idx, ((blob1, blob_value1), (blob2, blob_value2))) in enumerate(zip(first_net_results, net_results)): _assert_close(blob_value1, blob_value2, threshold, err_msg='Different forward pass results for output id {}. Corresponding output blobs: {} and {}'.format(idx, blob1, blob2)) assert (net_grads.keys() == first_net_grads.keys()) for (blob, blob_grad_value) in net_grads.items(): _assert_close(first_net_grads[blob], blob_grad_value, threshold, err_msg='Different gradients for input {}'.format(blob)) def Check(net, outputs_with_grad, input_values, input_to_check, step_size=0.0001, threshold=0.05, print_net=True): (net_results, net_grads, full_net) = _get_grad(net, [], outputs_with_grad, input_values, [input_to_check]) analytic_grad = net_grads[input_to_check] def GetLoss(new_value): workspace.blobs[input_to_check] = new_value workspace.RunNetOnce(full_net) return sum([workspace.blobs[output] for output in outputs_with_grad]).sum() def GetValue(dim, delta): input_value = input_values[input_to_check].copy() input_value.flat[dim] += delta return input_value grad_estimate = np.zeros_like(input_values[input_to_check]) for dim in range(input_values[input_to_check].size): pos_loss = GetLoss(GetValue(dim, step_size)) neg_loss = GetLoss(GetValue(dim, (- step_size))) grad_estimate.flat[dim] = (((pos_loss - neg_loss) / step_size) / 2) err_msg = 'Error in gradient check for net_copy {}'.format(net.Name()) if print_net: err_msg += ': {}'.format(net.Proto()) return _assert_close(analytic_grad, grad_estimate, threshold, err_msg)
class GrayReconstruction(): param_names = ['shape', 'dtype'] params = [((10, 10), (64, 64), (1200, 1200), (96, 96, 96)), (np.uint8, np.float32, np.float64)] def setup(self, shape, dtype): rng = np.random.default_rng(123) rvals = rng.integers(1, 255, size=shape).astype(dtype=dtype) roi1 = tuple((slice((s // 4), (s // 2)) for s in rvals.shape)) roi2 = tuple((slice(((s // 2) + 1), ((3 * s) // 4)) for s in rvals.shape)) seed = np.full(rvals.shape, 1, dtype=dtype) seed[roi1] = rvals[roi1] seed[roi2] = rvals[roi2] mask = np.full(seed.shape, 1, dtype=dtype) mask[roi1] = 255 mask[roi2] = 255 self.seed = seed self.mask = mask def time_reconstruction(self, shape, dtype): morphology.reconstruction(self.seed, self.mask) def peakmem_reference(self, *args): pass def peakmem_reconstruction(self, shape, dtype): morphology.reconstruction(self.seed, self.mask)
class Unet(nn.Module): def __init__(self, input_channels, num_classes, num_filters, initializers, apply_last_layer=True, padding=True): super(Unet, self).__init__() self.input_channels = input_channels self.num_classes = num_classes self.num_filters = num_filters self.padding = padding self.activation_maps = [] self.apply_last_layer = apply_last_layer self.contracting_path = nn.ModuleList() for i in range(len(self.num_filters)): input = (self.input_channels if (i == 0) else output) output = self.num_filters[i] if (i == 0): pool = False else: pool = True self.contracting_path.append(DownConvBlock(input, output, initializers, padding, pool=pool)) self.upsampling_path = nn.ModuleList() n = (len(self.num_filters) - 2) for i in range(n, (- 1), (- 1)): input = (output + self.num_filters[i]) output = self.num_filters[i] self.upsampling_path.append(UpConvBlock(input, output, initializers, padding)) if self.apply_last_layer: self.last_layer = nn.Conv2d(output, num_classes, kernel_size=1) def forward(self, x, val): blocks = [] for (i, down) in enumerate(self.contracting_path): x = down(x) if (i != (len(self.contracting_path) - 1)): blocks.append(x) for (i, up) in enumerate(self.upsampling_path): x = up(x, blocks[((- i) - 1)]) del blocks if val: self.activation_maps.append(x) if self.apply_last_layer: x = self.last_layer(x) return x
class ProtocolServer(Protocol): _req_received = None def __init__(self, request_queue, response_queue): self.request_queue = request_queue self.response_queue = response_queue self._req_received = None def have_pending_request(self): return (self._req_received is not None) def get_new_request(self, block=False): if self.have_pending_request(): raise Exception('Trying to get next request, while having one unserved') try: response = self.request_queue.get(block=block) except Exception as e: raise EmptyQueue('queue is empty') self._req_received = response return response def response_reset(self): if (not self.have_pending_request()): raise Exception('Attempting to reply with pending request') if (not isinstance(self._req_received, communication.messages.ResetIteratorRequest)): raise Exception('Replaying with reset status to other type of message') self.response_queue.put(communication.messages.ResetIteratorResponse()) self._req_received = None def response_next(self, value): if (not self.have_pending_request()): raise Exception('Attempting to reply with pending request') self.response_queue.put(communication.messages.GetNextResponse(value)) self._req_received = None def response_stop(self): if (not self.have_pending_request()): raise Exception('Attempting to reply with pending request') self.response_queue.put(communication.messages.StopIterationResponse()) self._req_received = None def response_invalid(self): if (not self.have_pending_request()): raise Exception('Attempting to reply with pending request') self.response_queue.put(communication.messages.InvalidStateResponse()) self._req_received = None def response_terminate(self): if (not self.have_pending_request()): raise Exception('Attempting to reply with pending request') if (not isinstance(self._req_received, communication.messages.TerminateRequest)): raise Exception('Replaying with terminate status to other type of message') self.response_queue.put(communication.messages.TerminateResponse()) self._req_received = None
def test_clip(): default_clipid = '1-104089-A-22' dataset = esc50.Dataset(TEST_DATA_HOME) clip = dataset.clip(default_clipid) expected_attributes = {'audio_path': os.path.join(os.path.normpath('tests/resources/sound_datasets/esc50/'), 'audio/1-104089-A-22.wav'), 'clip_id': '1-104089-A-22'} expected_property_types = {'filename': str, 'fold': int, 'target': int, 'category': str, 'esc10': bool, 'src_file': str, 'take': str, 'audio': tuple, 'tags': annotations.Tags} run_clip_tests(clip, expected_attributes, expected_property_types)
def wavy(ind, k=10.0): return ((1.0 - (sum(((math.cos((k * ind[i])) * math.exp(((- (ind[i] * ind[i])) / 2.0))) for i in range(len(ind)))) / float(len(ind)))),)
class TFMPNetForSequenceClassification(): def __init__(self, *args, **kwargs): requires_tf(self) def from_pretrained(self, *args, **kwargs): requires_tf(self)
class ReduceLR(TrainingBase): def get_default_config(self): config = super().get_default_config() config.update(rlr_factor=0.5, rlr_patience=10, min_lr=1e-06, stopping_lr=0.0, rlr_monitor='val_loss', rlr_monitor_improves_when='less') return config def get_default_state(self): state = super().get_default_state() state.update(last_rlr_epoch=(- 1)) if (self.config.rlr_monitor_improves_when == 'less'): state.update(rlr_monitor_value=np.inf, rlr_monitor_epoch=(- 1)) elif (self.config.rlr_monitor_improves_when == 'greater'): state.update(rlr_monitor_value=0, rlr_monitor_epoch=(- 1)) else: raise ValueError return state def on_epoch_begin(self, logs, training): super().on_epoch_begin(logs, training) if ('lr' not in logs): logs['lr'] = max((group['lr'] for group in self.optimizer.param_groups)) def on_epoch_end(self, logs, training): super().on_epoch_end(logs, training) if training: return config = self.config state = self.state monitor = config.rlr_monitor try: new_value = logs[monitor] new_epoch = logs['epoch'] except KeyError: print(f'Warning: RLR: COULD NOT FIND LOG!', flush=True) return old_value = state.rlr_monitor_value old_epoch = state.rlr_monitor_epoch if (((self.config.rlr_monitor_improves_when == 'less') and (new_value <= old_value)) or ((self.config.rlr_monitor_improves_when == 'greater') and (new_value >= old_value))): state.rlr_monitor_value = new_value state.rlr_monitor_epoch = new_epoch elif (config.rlr_factor < 1): epoch_gap = (new_epoch - max(state.last_rlr_epoch, old_epoch)) if (epoch_gap >= config.rlr_patience): old_lrs = [] new_lrs = [] for group in self.optimizer.param_groups: old_lr = group['lr'] new_lr = max((old_lr * config.rlr_factor), config.min_lr) group['lr'] = new_lr old_lrs.append(old_lr) new_lrs.append(new_lr) old_lr = max(old_lrs) new_lr = max(new_lrs) logs['lr'] = new_lr state.last_rlr_epoch = new_epoch if self.is_main_rank: print((f''' RLR: {monitor} did NOT improve for {epoch_gap} epochs,''' + f' new lr = {new_lr}'), flush=True) if (new_lr < config.stopping_lr): if self.is_main_rank: print(f''' STOP: lr fell below {config.stopping_lr}, STOPPING TRAINING!''', flush=True) raise StopTrainingException
def register_Ns3LteRrcSapSystemInformationBlockType1_methods(root_module, cls): cls.add_constructor([]) cls.add_constructor([param('ns3::LteRrcSap::SystemInformationBlockType1 const &', 'arg0')]) cls.add_instance_attribute('cellAccessRelatedInfo', 'ns3::LteRrcSap::CellAccessRelatedInfo', is_const=False) cls.add_instance_attribute('cellSelectionInfo', 'ns3::LteRrcSap::CellSelectionInfo', is_const=False) return
def _from_notebook_node(self, nb, resources, **kwargs): filters = [RTDUrlPreprocessor()] for f in filters: (nb, resources) = f.preprocess(nb, resources=resources) return nbsphinx_from_notebook_node(self, nb, resources=resources, **kwargs)
def _py_deprecation(ver_python=(3, 6), ver_stardist='0.9.0'): import sys from distutils.version import LooseVersion if ((sys.version_info[:2] == ver_python) and (LooseVersion(__version__) < LooseVersion(ver_stardist))): print(f'''You are using Python {ver_python[0]}.{ver_python[1]}, which will no longer be supported in StarDist {ver_stardist}. Please upgrade to Python {ver_python[0]}.{(ver_python[1] + 1)} or later.''', file=sys.stderr, flush=True)
def read_regl(variables, num_strands=3): (u, v, w) = variables data = {} data[2] = ([3], [[{(0, 1): (- v), (0, 2): 1, (1, 0): 1, (1, 1): u, (2, 1): w}]], [[{(0, 1): 1, (0, 2): ((- u) / w), (1, 2): (1 / w), (2, 0): 1, (2, 2): (v / w)}]]) data[3] = ([24], [[{(0, 1): (- v), (0, 2): 1, (1, 0): 1, (1, 1): u, (2, 1): w, (3, 5): (- v), (3, 7): 1, (4, 6): (- v), (4, 8): 1, (5, 3): 1, (5, 5): u, (6, 4): 1, (6, 6): u, (7, 5): w, (8, 6): w, (9, 9): u, (9, 15): 1, (10, 10): u, (10, 17): 1, (11, 9): w, (12, 10): w, (13, 13): u, (13, 16): 1, (14, 13): w, (15, 9): (- v), (15, 11): 1, (16, 13): (- v), (16, 14): 1, (17, 10): (- v), (17, 12): 1, (18, 19): (- v), (18, 20): 1, (19, 18): 1, (19, 19): u, (20, 19): w, (21, 22): (- v), (21, 23): 1, (22, 21): 1, (22, 22): u, (23, 22): w}, {(0, 3): (- v), (0, 4): 1, (1, 15): (- v), (1, 16): 1, (1, 22): (- v), (1, 23): ((u * v) / w), (2, 17): (- v), (2, 18): 1, (2, 23): ((v * ((u * v) - w)) / w), (3, 0): 1, (3, 3): u, (4, 3): w, (5, 9): (- v), (5, 10): 1, (5, 12): ((- u) / w), (5, 22): u, (5, 23): ((- (u ** 2)) / w), (6, 11): (- v), (6, 22): w, (6, 23): (- u), (7, 12): (((- u) * v) / w), (7, 13): (- v), (7, 19): 1, (7, 21): (- v), (7, 23): (((- (u ** 2)) * v) / w), (8, 12): (- v), (8, 14): (- v), (8, 20): 1, (8, 23): ((- u) * v), (9, 5): 1, (9, 9): u, (9, 23): (u / w), (10, 9): w, (10, 11): (- u), (11, 6): 1, (11, 11): u, (11, 13): u, (12, 13): w, (12, 23): (- v), (13, 23): 1, (14, 8): 1, (14, 14): u, (14, 23): v, (15, 1): 1, (15, 12): (u / w), (15, 15): u, (16, 11): v, (16, 15): w, (16, 23): (- u), (17, 2): 1, (17, 12): ((u * v) / w), (17, 17): u, (18, 12): v, (18, 17): w, (19, 21): w, (19, 23): v, (20, 14): w, (21, 7): 1, (21, 21): u, (21, 23): ((u * v) / w), (22, 11): 1, (23, 12): 1, (23, 23): u}]], [[{(0, 1): 1, (0, 2): ((- u) / w), (1, 2): (1 / w), (2, 0): 1, (2, 2): (v / w), (3, 5): 1, (3, 7): ((- u) / w), (4, 6): 1, (4, 8): ((- u) / w), (5, 7): (1 / w), (6, 8): (1 / w), (7, 3): 1, (7, 7): (v / w), (8, 4): 1, (8, 8): (v / w), (9, 11): (1 / w), (10, 12): (1 / w), (11, 11): (v / w), (11, 15): 1, (12, 12): (v / w), (12, 17): 1, (13, 14): (1 / w), (14, 14): (v / w), (14, 16): 1, (15, 9): 1, (15, 11): ((- u) / w), (16, 13): 1, (16, 14): ((- u) / w), (17, 10): 1, (17, 12): ((- u) / w), (18, 19): 1, (18, 20): ((- u) / w), (19, 20): (1 / w), (20, 18): 1, (20, 20): (v / w), (21, 22): 1, (21, 23): ((- u) / w), (22, 23): (1 / w), (23, 21): 1, (23, 23): (v / w)}, {(0, 3): 1, (0, 4): ((- u) / w), (1, 15): 1, (1, 16): ((- u) / w), (1, 22): ((u * v) / w), (1, 23): ((- u) / w), (2, 17): 1, (2, 18): ((- u) / w), (3, 4): (1 / w), (4, 0): 1, (4, 4): (v / w), (5, 9): 1, (5, 10): ((- u) / w), (5, 13): ((- u) / w), (5, 22): ((- (u ** 2)) / w), (6, 11): 1, (6, 12): ((- u) / w), (6, 13): (((- u) * v) / w), (6, 22): (- u), (7, 19): ((- u) / w), (7, 21): 1, (8, 13): (- v), (8, 14): 1, (8, 20): ((- u) / w), (9, 10): (1 / w), (9, 22): (u / w), (10, 5): 1, (10, 6): ((- u) / w), (10, 10): (v / w), (10, 13): ((- (u ** 2)) / w), (10, 23): (u / w), (11, 22): 1, (12, 13): (- u), (12, 23): 1, (13, 12): (1 / w), (13, 13): (v / w), (14, 20): (1 / w), (15, 13): (u / w), (15, 16): (1 / w), (15, 22): ((- v) / w), (16, 1): 1, (16, 6): (v / w), (16, 13): ((u * v) / w), (16, 16): (v / w), (17, 13): ((u * v) / w), (17, 18): (1 / w), (17, 23): ((- v) / w), (18, 2): 1, (18, 13): v, (18, 18): (v / w), (18, 23): ((- (v ** 2)) / w), (19, 7): 1, (19, 12): (v / w), (19, 19): (v / w), (19, 23): ((u * v) / w), (20, 8): 1, (20, 20): (v / w), (20, 23): v, (21, 13): ((- v) / w), (21, 19): (1 / w), (22, 6): (1 / w), (22, 13): (u / w), (22, 22): (v / w), (23, 13): 1}]]) return data[num_strands]
class ToricDivisor_generic(Divisor_generic): def __init__(self, v, parent, check=True, reduce=True): super().__init__(v, parent, check, reduce) def _vector_(self, ring=None): if (ring is None): ring = self.base_ring() X = self.parent().scheme() v = vector(ring, ([0] * X.ngens())) for (coeff, variable) in self: v[X.gens().index(variable)] += coeff return v def coefficient(self, x): try: index = ZZ(x) variable = self.parent().scheme().gen(index) except TypeError: variable = x for (coeff, var) in self: if (var == variable): return coeff return self.base_ring().zero() def function_value(self, point): if (not self.is_QQ_Cartier()): raise ValueError(('support functions are associated to QQ-Cartier divisors only, %s is not QQ-Cartier' % self)) try: index = ZZ(point) return self.coefficient(index) except TypeError: pass fan = self.parent().scheme().fan() assert (point in fan.lattice()), (('The point ' + str(point)) + ' is not in the N-lattice.') cone = fan.cone_containing(point) return (point * self.m(cone)) def m(self, cone): try: return self._m[cone] except AttributeError: self._m = {} except KeyError: pass X = self.parent().scheme() M = X.fan().dual_lattice() fan = X.fan() cone = fan.embed(cone) if cone.is_trivial(): m = M(0) self._m[cone] = m return m assert (cone.ambient() is fan) b = vector((self.coefficient(i) for i in cone.ambient_ray_indices())) A = cone.rays().column_matrix() try: if (cone.dim() == X.dimension()): m = A.solve_left(b) else: (D, U, V) = A.smith_form() bV = (b * V) m = (D.solve_left(bV) * U) except ValueError: raise ValueError(('%s is not QQ-Cartier, cannot choose a dual vector on %s' % (self, cone))) try: m = M(m) except TypeError: pass self._m[cone] = m return m def is_Weil(self): if (self.base_ring() == ZZ): return True try: vector(ZZ, vector(self)) return True except TypeError: return False def is_QQ_Weil(self): return True def is_Cartier(self): try: return self._is_Cartier except AttributeError: pass self._is_Cartier = self.is_QQ_Cartier() if self._is_Cartier: fan = self.parent().scheme().fan() M = fan.dual_lattice() self._is_Cartier = all(((self.m(c) in M) for c in fan)) return self._is_Cartier def is_QQ_Cartier(self): try: return self._is_QQ_Cartier except AttributeError: pass try: [self.m(c) for c in self.parent().scheme().fan()] self._is_QQ_Cartier = True except ValueError: self._is_QQ_Cartier = False return self._is_QQ_Cartier def is_integral(self): return all(((coeff in ZZ) for (coeff, _) in self)) def move_away_from(self, cone): m = self.m(cone) X = self.parent().scheme() fan = X.fan() if (m in fan.lattice()): ring = self._ring else: ring = m.base_ring() divisor = list(vector(self)) values = [(mult - (m * ray)) for (mult, ray) in zip(divisor, fan.rays())] return ToricDivisor(X, values, ring=ring) def cohomology_class(self): divisor = vector(self) variety = self.parent().scheme() HH = variety.cohomology_ring() return sum([(divisor[i] * HH.gen(i)) for i in range(HH.ngens())]) def Chern_character(self): return self.cohomology_class().exp() ch = Chern_character def divisor_class(self): if ('_divisor_class' not in self.__dict__): self._divisor_class = self.parent().scheme().rational_class_group()(self) return self._divisor_class def Chow_cycle(self, ring=ZZ): toric_variety = self.parent().scheme() fan = toric_variety.fan() A = toric_variety.Chow_group(ring) return sum(((self.coefficient(i) * A(cone_1d)) for (i, cone_1d) in enumerate(fan(dim=1)))) def is_ample(self): try: return self._is_ample except AttributeError: pass assert self.is_QQ_Cartier(), 'The divisor must be QQ-Cartier.' Kc = self.parent().scheme().Kaehler_cone() self._is_ample = Kc.relative_interior_contains(self.divisor_class()) return self._is_ample def is_nef(self): try: return self._is_nef except AttributeError: pass assert self.is_QQ_Cartier(), 'The divisor must be QQ-Cartier.' self._is_nef = (self.divisor_class() in self.parent().scheme().Kaehler_cone()) return self._is_nef def polyhedron(self): try: return self._polyhedron except AttributeError: pass fan = self.parent().scheme().fan() divisor = vector(self) ieqs = [([divisor[i]] + list(fan.ray(i))) for i in range(fan.nrays())] self._polyhedron = Polyhedron(ieqs=ieqs) return self._polyhedron def sections(self): try: return self._sections except AttributeError: pass M = self.parent().scheme().fan().dual_lattice() self._sections = tuple((M(m) for m in self.polyhedron().integral_points())) return self._sections def sections_monomials(self): return tuple((self.monomial(m) for m in self.sections())) def monomial(self, point): X = self.parent().scheme() fan = X.fan() assert (point in fan.dual_lattice()), f'{point} must be a point in the M-lattice' R = X.coordinate_ring() return prod([(R.gen(i) ** ((point * fan.ray(i)) + self.coefficient(i))) for i in range(fan.nrays())]) def Kodaira_map(self, names='z'): sections = self.sections_monomials() if (not sections): raise ValueError('the Kodaira map is not defined for divisors without sections') src = self.parent().scheme() from sage.schemes.projective.projective_space import ProjectiveSpace ambient = ProjectiveSpace(src.base_ring(), (len(sections) - 1), names=names) A = matrix(ZZ, [list(s.exponents()[0]) for s in sections]).transpose() from sage.schemes.toric.ideal import ToricIdeal IA = ToricIdeal(A, names=names) dst = ambient.subscheme(IA) homset = src.Hom(dst) return homset(sections) def _sheaf_complex(self, m): fan = self.parent().scheme().fan() ray_is_negative = [(((m * ray) + self.coefficient(i)) < 0) for (i, ray) in enumerate(fan.rays())] def cone_is_negative(cone): if cone.is_trivial(): return False return all((ray_is_negative[i] for i in cone.ambient_ray_indices())) negative_cones = [cone for cone in flatten(fan.cones()) if cone_is_negative(cone)] return SimplicialComplex([c.ambient_ray_indices() for c in negative_cones]) def _sheaf_cohomology(self, cplx): d = self.parent().scheme().dimension() if (cplx.dimension() == (- 1)): return vector(ZZ, ([1] + ([0] * d))) HH = cplx.homology(base_ring=QQ, cohomology=True) HH_list = ([0] * (d + 1)) for h in HH.items(): degree = (h[0] + 1) cohomology_dim = h[1].dimension() if ((degree > d) or (degree < 0)): assert (cohomology_dim == 0) continue HH_list[degree] = cohomology_dim return vector(ZZ, HH_list) def _sheaf_cohomology_support(self): X = self.parent().scheme() fan = X.fan() if (not X.is_complete()): raise ValueError(('%s is not complete, its cohomology is not finite-dimensional' % X)) d = X.dimension() chamber_vertices = [] for pindexlist in Combinations(range(fan.nrays()), d): A = matrix(ZZ, [fan.ray(p) for p in pindexlist]) b = vector([self.coefficient(p) for p in pindexlist]) try: chamber_vertices.append(A.solve_right((- b))) except ValueError: pass return Polyhedron(vertices=chamber_vertices) def cohomology(self, weight=None, deg=None, dim=False): if (('_cohomology_vector' in self.__dict__) and (weight is None)): HH = self._cohomology_vector else: X = self.parent().scheme() M = X.fan().dual_lattice() support = self._sheaf_cohomology_support() if (weight is None): m_list = [M(p) for p in support.integral_points()] else: m_list = [M(weight)] HH = vector(ZZ, ([0] * (X.dimension() + 1))) for m_point in m_list: cplx = self._sheaf_complex(m_point) HH += self._sheaf_cohomology(cplx) if (weight is None): self._cohomology_vector = HH if dim: if (deg is None): return HH else: return HH[deg] else: from sage.modules.free_module import VectorSpace vectorspaces = {k: VectorSpace(self.scheme().base_ring(), HH[k]) for k in range(len(HH))} if (deg is None): return vectorspaces else: return vectorspaces[deg] def cohomology_support(self): X = self.parent().scheme() M = X.fan().dual_lattice() support_hull = self._sheaf_cohomology_support() support_hull = [M(p) for p in support_hull.integral_points()] support = [] for m in support_hull: cplx = self._sheaf_complex(m) HH = self._sheaf_cohomology(cplx) if (sum(HH) > 0): support.append(m) return tuple(support)
def obtain_script_grounded_in_graph(lines_program, id_mapping, modified_script): reverse_id_mapping = {} for (object_script, id_sim) in id_mapping.items(): reverse_id_mapping[id_sim] = object_script new_script = [] for script_line in modified_script: script_line_str = '[{}]'.format(script_line.action.name) if script_line.object(): try: script_line_str += ' <{}> ({})'.format(*reverse_id_mapping[script_line.object().instance]) except: print(id_mapping) print(script_line.object().instance) if script_line.subject(): script_line_str += ' <{}> ({})'.format(*reverse_id_mapping[script_line.subject().instance]) new_script.append(script_line_str) lines_program = (lines_program[:4] + new_script) return lines_program
def set_map_fn(train_results: dict, task_settable_env: PcgrlEnv, env_ctx: EnvContext) -> TaskType: if (not task_settable_env.evaluation_env): return None if task_settable_env.unwrapped._has_been_assigned_map: map_idx = (task_settable_env.cur_map_idx + env_ctx['num_eval_envs']) else: map_idx = ((task_settable_env.cur_map_idx + (env_ctx.worker_index * env_ctx['num_envs_per_worker'])) + env_ctx.vector_index) task_settable_env.unwrapped._has_been_assigned_map = True map_idx = (map_idx % len(task_settable_env.unwrapped._prob.eval_maps)) print(f'Assigning map {map_idx} to environment {env_ctx.vector_index} of worker {env_ctx.worker_index}.') return map_idx
def write_prediction(pred_dict, batch, pred_y): for (idx, (sample, py)) in enumerate(zip(batch, pred_y)): (past, ground_truth, pose, vid, frame, pid, flipped, egomotion, scale, mag, size) = sample (frame, pid) = (str(frame), str(pid)) err = np.linalg.norm((py - ground_truth), axis=1)[(- 1)] front_cnt = sum([(1 if ((ps[11][0] - ps[8][0]) > 0) else 0) for ps in pose]) hip_dist = np.mean([np.abs((ps[(11, 0)] - ps[(8, 0)])) for ps in pose]) front_ratio = (front_cnt / len(pose)) if (hip_dist < 0.25): traj_type = 2 elif (front_ratio > 0.75): traj_type = 0 elif (front_ratio < 0.25): traj_type = 1 else: traj_type = 3 if (vid not in pred_dict): pred_dict[vid] = {} if (frame not in pred_dict[vid]): pred_dict[vid][frame] = {} result = [vid, frame, pid, flipped, py, None, None, err, traj_type] result = list(map((lambda x: (x.tolist() if (type(x).__module__ == 'numpy') else x)), result)) pred_dict[vid][frame][pid] = result
def test_var_get_position_no_statements(test_case_mock): ref = vr.VariableReference(test_case_mock, int) test_case_mock.statements = [] with pytest.raises(Exception): ref.get_statement_position()
def get_sub_dataset(pid2name, num_id=2000): pids_all = sorted(pid2name.keys()) pids_sub = random.sample(pids_all, num_id) data_sub = [] for pid in pids_sub: lines = pid2name[pid] data_sub += lines return data_sub
def typeset_term_syntax(term_class): if ((len(term_class.arg_types) >= 1) and (not isinstance(term_class.arg_types[0], str))): is_param = (len([arg for arg in term_class.arg_types[(- 1)] if arg.startswith('parameter')]) > 0) is_vs = (len([arg for arg in term_class.arg_types[0] if (arg in ['virtual', 'state'])]) > 0) arg_types_ = [list(k) for k in term_class.arg_types] if (is_param and is_vs): at0 = arg_types_[0] at1 = arg_types_[(- 1)] for k in range(len(at0)): if ((at0[k] in ['virtual', 'state']) and at1[k].startswith('parameter')): aux = at1[k].replace('parameter', 'param') at0[k] = ((at0[k] + '/') + aux) arg_types_ = arg_types_[:(- 1)] arg_types = [', '.join([('``<%s>``' % arg) for arg in arg_type]) for arg_type in arg_types_] text = '\n\n '.join(arg_types) else: text = ', '.join([('``<%s>``' % arg) for arg in term_class.arg_types]) return text
class Issue19OneDataPointAtATime(ReBenchTestCase): def setUp(self): super(Issue19OneDataPointAtATime, self).setUp() self._set_path(__file__)
class BertTokenizer(Tokenizer): def __init__(self, tokenizer): super().__init__() self._tokenizer = tokenizer self._tokenizer.pad_token = '<pad>' self._tokenizer.eos_token = '<eos>' self._tokenizer.unk_token = '<unk>' def encode(self, s: str) -> List[int]: reduced_idx = [] for idx in self._tokenizer.encode(s): try: r_idx = (idx - BERT_FIRST_IDX) assert (r_idx > 0) reduced_idx.append(r_idx) except AssertionError: reduced_idx.append(self.unk_idx) reduced_idx.append(self.eos_idx) return reduced_idx def decode(self, idxs: List[int], ignore_repeat: bool=False) -> str: crop_idx = [] for (t, idx) in enumerate(idxs): if (idx == self.eos_idx): break elif ((idx == self.pad_idx) or (ignore_repeat and (t > 0) and (idx == idxs[(t - 1)]))): continue else: crop_idx.append((idx + BERT_FIRST_IDX)) return self._tokenizer.decode(crop_idx) def load_from_file(cls, vocab_file: str): from pytorch_transformers import BertTokenizer as bert_tokenizer return cls(bert_tokenizer.from_pretrained(vocab_file)) def vocab_size(self) -> int: return ((BERT_LAST_IDX - BERT_FIRST_IDX) + 1) def token_type(self) -> str: return 'bert'
def grad(outputs, inputs, grad_outputs=None, persistent_outputs=[], bind_grad_output=False): grad_outputs = Grad()(outputs, inputs, grad_outputs=grad_outputs, persistent_outputs=persistent_outputs, bind_grad_output=bind_grad_output) return grad_outputs
def base_axis_2_reshape_without_neg_1(x): h = PF.convolution(x, 3, (3, 3), pad=(0, 0), name='c1', base_axis=2) y = F.reshape(h, shape=(2, 18, 6)) return y
def get_matrix_clusterers(cluster_count=3): base_clusterers = [KMeans(cluster_count)] for base_clusterer in base_clusterers: (yield MatrixLabelSpaceClusterer(base_clusterer, False))
def _add_scores_to_sentences(sentences, scores): for sentence in sentences: if (sentence.token in scores): sentence.score = scores[sentence.token] else: sentence.score = 0
def create_pipeline_configuration(DEBUG=False, batch_size=4): config = {'batch_dim': 0, 'depth': 10000, 'basic_blocks': (T5Block, Linear, T5LayerNorm, CrossEntropyLoss, Dropout, StatelessEmbedding), 'model_inputs': {'attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'is_batched': True, 'used_by': [0, 1, 2, 3, 4, 5]}, 'decoder_attention_mask': {'shape': torch.Size([4, 1, 4, 4]), 'dtype': torch.float32, 'is_batched': True, 'used_by': [5, 6, 7]}, 'decoder_input_ids': {'shape': torch.Size([4, 4]), 'dtype': torch.int64, 'is_batched': True, 'used_by': [0, 5]}, 'input_ids': {'shape': torch.Size([4, 512]), 'dtype': torch.int64, 'is_batched': True, 'used_by': [0]}, 'inverted_encoder_attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'is_batched': True, 'used_by': [5, 6, 7]}, 'lm_labels': {'shape': torch.Size([4, 4]), 'dtype': torch.int64, 'is_batched': True, 'used_by': [7]}}, 'model_outputs': {'T5ForConditionalGeneration/CrossEntropyLoss[lm_loss]': {'shape': torch.Size([1]), 'dtype': torch.float32, 'is_batched': False, 'created_by': 7}}, 'stages': {0: {'stage_cls': Partition0, 'inputs': {'attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'decoder_input_ids': {'shape': torch.Size([4, 4]), 'dtype': torch.int64, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'input_ids': {'shape': torch.Size([4, 512]), 'dtype': torch.int64, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}}, 'outputs': {'T5ForConditionalGeneration/T5Stack[decoder]/Tensor::size_117': {'shape': torch.Size([2]), 'dtype': torch.Size, 'req_grad': False, 'is_batched': False, 'used_by': [5]}, 'T5ForConditionalGeneration/Parameter[shared_embed_weight]': {'shape': torch.Size([32100, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': False, 'used_by': [5]}, 'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_1': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [1]}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[3]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [1]}}, 'devices': [('cpu' if DEBUG else 'cuda:0')], 'stage_depth': 7}, 1: {'stage_cls': Partition1, 'inputs': {'attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_1': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 0}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[3]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 0}}, 'outputs': {'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_2': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [2]}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[7]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [2]}}, 'devices': [('cpu' if DEBUG else 'cuda:1')], 'stage_depth': 6}, 2: {'stage_cls': Partition2, 'inputs': {'attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_2': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 1}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[7]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 1}}, 'outputs': {'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_3': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [3]}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[11]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [3]}}, 'devices': [('cpu' if DEBUG else 'cuda:2')], 'stage_depth': 5}, 3: {'stage_cls': Partition3, 'inputs': {'attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_3': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 2}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[11]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 2}}, 'outputs': {'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_4': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [4]}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[15]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [4]}}, 'devices': [('cpu' if DEBUG else 'cuda:3')], 'stage_depth': 4}, 4: {'stage_cls': Partition4, 'inputs': {'attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_4': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 3}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[15]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 3}}, 'outputs': {'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_5': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [5]}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[19]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [5]}}, 'devices': [('cpu' if DEBUG else 'cuda:4')], 'stage_depth': 3}, 5: {'stage_cls': Partition5, 'inputs': {'attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'decoder_attention_mask': {'shape': torch.Size([4, 1, 4, 4]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'decoder_input_ids': {'shape': torch.Size([4, 4]), 'dtype': torch.int64, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'inverted_encoder_attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'T5ForConditionalGeneration/T5Stack[decoder]/Tensor::size_117': {'shape': torch.Size([2]), 'dtype': torch.Size, 'req_grad': False, 'is_batched': False, 'created_by': 0}, 'T5ForConditionalGeneration/Parameter[shared_embed_weight]': {'shape': torch.Size([32100, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': False, 'created_by': 0}, 'T5ForConditionalGeneration/T5Stack[encoder]/tuple::__getitem___22_5': {'shape': torch.Size([4, 32, 512, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 4}, 'T5ForConditionalGeneration/T5Stack[encoder]/T5Block[19]': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 4}}, 'outputs': {'T5ForConditionalGeneration/T5Stack[encoder]/Dropout[dropout]_6': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [6]}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___128': {'shape': torch.Size([4, 4, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [6]}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___130_6': {'shape': torch.Size([4, 32, 4, 4]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [6]}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___132_6': {'shape': torch.Size([4, 32, 4, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [6]}}, 'devices': [('cpu' if DEBUG else 'cuda:5')], 'stage_depth': 2}, 6: {'stage_cls': Partition6, 'inputs': {'decoder_attention_mask': {'shape': torch.Size([4, 1, 4, 4]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'inverted_encoder_attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'T5ForConditionalGeneration/T5Stack[encoder]/Dropout[dropout]_6': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 5}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___128': {'shape': torch.Size([4, 4, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 5}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___130_6': {'shape': torch.Size([4, 32, 4, 4]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 5}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___132_6': {'shape': torch.Size([4, 32, 4, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 5}}, 'outputs': {'T5ForConditionalGeneration/T5Stack[encoder]/Dropout[dropout]_7': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [7]}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___130_7': {'shape': torch.Size([4, 32, 4, 4]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [7]}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___132_7': {'shape': torch.Size([4, 32, 4, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [7]}, 'T5ForConditionalGeneration/T5Stack[decoder]/T5Block[12]': {'shape': torch.Size([4, 4, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'used_by': [7]}}, 'devices': [('cpu' if DEBUG else 'cuda:6')], 'stage_depth': 1}, 7: {'stage_cls': Partition7, 'inputs': {'decoder_attention_mask': {'shape': torch.Size([4, 1, 4, 4]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'inverted_encoder_attention_mask': {'shape': torch.Size([4, 1, 1, 512]), 'dtype': torch.float32, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'lm_labels': {'shape': torch.Size([4, 4]), 'dtype': torch.int64, 'req_grad': False, 'is_batched': True, 'created_by': (- 1)}, 'T5ForConditionalGeneration/T5Stack[encoder]/Dropout[dropout]_7': {'shape': torch.Size([4, 512, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 6}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___130_7': {'shape': torch.Size([4, 32, 4, 4]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 6}, 'T5ForConditionalGeneration/T5Stack[decoder]/tuple::__getitem___132_7': {'shape': torch.Size([4, 32, 4, 512]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 6}, 'T5ForConditionalGeneration/T5Stack[decoder]/T5Block[12]': {'shape': torch.Size([4, 4, 1024]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': True, 'created_by': 6}}, 'outputs': {'T5ForConditionalGeneration/CrossEntropyLoss[lm_loss]': {'shape': torch.Size([1]), 'dtype': torch.float32, 'req_grad': True, 'is_batched': False, 'used_by': [(- 1)]}}, 'devices': [('cpu' if DEBUG else 'cuda:7')], 'stage_depth': 0}}} batch_dim = config['batch_dim'] for d in chain(config['model_inputs'].values(), config['model_outputs'].values()): if d['is_batched']: shape = d['shape'] d['shape'] = torch.Size(((shape[:batch_dim] + (batch_size,)) + shape[(batch_dim + 1):])) for s in config['stages'].values(): for d in chain(s['inputs'].values(), s['outputs'].values()): if d['is_batched']: shape = d['shape'] d['shape'] = torch.Size(((shape[:batch_dim] + (batch_size,)) + shape[(batch_dim + 1):])) return config
def create_loss(): bounds = (0.1, 3.0) obs = zfit.Space('x', limits=bounds) np.random.seed(0) tau = (- 2.0) beta = ((- 1) / tau) bkg = np.random.exponential(beta, 300) peak = np.random.normal(1.2, 0.1, 25) data = np.concatenate((bkg, peak)) data = data[((data > bounds[0]) & (data < bounds[1]))] N = len(data) data = zfit.data.Data.from_numpy(obs=obs, array=data) lambda_ = zfit.Parameter('lambda', (- 2.0), (- 4.0), (- 1.0)) Nsig = zfit.Parameter('Nsig', 20.0, (- 20.0), N) Nbkg = zfit.Parameter('Nbkg', N, 0.0, (N * 1.1)) signal = zfit.pdf.Gauss(obs=obs, mu=1.2, sigma=0.1).create_extended(Nsig) background = zfit.pdf.Exponential(obs=obs, lambda_=lambda_).create_extended(Nbkg) tot_model = zfit.pdf.SumPDF([signal, background]) loss = ExtendedUnbinnedNLL(model=tot_model, data=data) poigen = POI(Nsig, 0.0) poieval = POIarray(Nsig, [0.0]) return (loss, (Nsig, poigen, poieval))
def test_non_list_index(): array = ak.Array([{'x': 10, 'y': 1.0}, {'x': 30, 'y': 20.0}, {'x': 40, 'y': 20.0}, {'x': 'hi', 'y': 20.0}]) assert (array[['x']].to_list() == [{'x': 10}, {'x': 30}, {'x': 40}, {'x': 'hi'}]) fields_ak = ak.Array(['x']) assert (array[fields_ak].to_list() == [{'x': 10}, {'x': 30}, {'x': 40}, {'x': 'hi'}]) fields_np = np.array(['x']) assert (array[fields_np].to_list() == [{'x': 10}, {'x': 30}, {'x': 40}, {'x': 'hi'}]) class SizedIterable(): def __len__(self): return 1 def __iter__(self): return iter(['y']) fields_custom = SizedIterable() assert (array[fields_custom].to_list() == [{'y': 1.0}, {'y': 20.0}, {'y': 20.0}, {'y': 20.0}]) fields_tuple = ('x',) assert (array[fields_tuple].to_list() == [10, 30, 40, 'hi'])
.parametrize('context, action_context, tau, err, description', invalid_input_of_linear_behavior_policy_logit) def test_linear_behavior_policy_logit_using_invalid_input(context, action_context, tau, err, description): if (description == ''): with pytest.raises(err): linear_behavior_policy_logit(context=context, action_context=action_context, tau=tau) else: with pytest.raises(err, match=f'{description}*'): linear_behavior_policy_logit(context=context, action_context=action_context, tau=tau)
def set_transformed_lm_head(model): model.set_output_embeddings(MyLMHeadWithTransform(model.lm_head))
class ConvLSTMCell(nn.Module): def __init__(self, input_channels, hidden_channels, kernel_size): super(ConvLSTMCell, self).__init__() self.input_channels = input_channels self.hidden_channels = hidden_channels self.kernel_size = kernel_size self.num_features = 4 self.padding = int(((kernel_size - 1) / 2)) self.W_i = nn.Conv2d(self.input_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=True) self.W_f = nn.Conv2d(self.input_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=True) self.W_o = nn.Conv2d(self.input_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=True) self.W_c = nn.Conv2d(self.input_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=True) self.reset_parameters() def forward(self, inputs, c): i_t = torch.sigmoid(self.W_i(inputs)) f_t = torch.sigmoid(self.W_f(inputs)) o_t = torch.sigmoid(self.W_o(inputs)) c_t = ((f_t * c) + (i_t * torch.tanh(self.W_c(inputs)))) h_t = (o_t * torch.tanh(c_t)) return (h_t, c_t) def reset_parameters(self): self.W_i.reset_parameters() self.W_f.reset_parameters() self.W_o.reset_parameters() self.W_c.reset_parameters()
def pioglitazone_mpo() -> GoalDirectedBenchmark: smiles = 'O=C1NC(=O)SC1Cc3ccc(OCCc2ncc(cc2)CC)cc3' pioglitazone = Chem.MolFromSmiles(smiles) target_molw = mol_weight(pioglitazone) similarity = TanimotoScoringFunction(smiles, fp_type='ECFP4', score_modifier=GaussianModifier(mu=0, sigma=0.1)) mw = RdkitScoringFunction(descriptor=mol_weight, score_modifier=GaussianModifier(mu=target_molw, sigma=10)) rb = RdkitScoringFunction(descriptor=num_rotatable_bonds, score_modifier=GaussianModifier(mu=2, sigma=0.5)) specification = uniform_specification(1, 10, 100) return GoalDirectedBenchmark(name='Pioglitazone MPO', objective=GeometricMeanScoringFunction([similarity, mw, rb]), contribution_specification=specification)
def eval_bool(x, default=False): if (x is None): return default try: return bool(eval(x)) except TypeError: return default
_numpy_output(non_zero=True, check_dtype=True) def test_ufunc_tan_f(A: dace.float32[10]): return np.tan(A)
def register_Ns3LteSpectrumSignalParametersUlSrsFrame_methods(root_module, cls): cls.add_method('Copy', 'ns3::Ptr< ns3::SpectrumSignalParameters >', [], is_virtual=True) cls.add_constructor([]) cls.add_constructor([param('ns3::LteSpectrumSignalParametersUlSrsFrame const &', 'p')]) cls.add_instance_attribute('cellId', 'uint16_t', is_const=False) return
def create_anomaly_layout() -> html.Div: return html.Div(id='anomaly_views', children=[html.Div(id='left-column-data', className='three columns', children=[create_control_panel()]), html.Div(className='nine columns', children=create_right_column())])
def warning_advice(self, *args, **kwargs): no_advisory_warnings = os.getenv('TRANSFORMERS_NO_ADVISORY_WARNINGS', False) if no_advisory_warnings: return self.warning(*args, **kwargs)
_converter_regitstry('sPorD') def sPorD_converter(context: 'SG2260Context', reg: sPorD_reg): (n, c, h, w) = (reg[f'res0_{d}'] for d in 'nchw') opd0 = dict(address=reg.opd0_addr, dtype=(reg.opt_opd0_prec, reg.opt_opd0_sign), shape=(n, c, reg.opd0_h, reg.opd0_w), layout=Layout.alignEU) res0 = dict(address=reg.res0_addr, dtype=(reg.opt_res0_prec, reg.opt_opd0_sign), shape=(n, c, h, w), layout=Layout.alignEU) opd1 = dict(address=reg.opd1_addr, dtype=(reg.opt_opd0_prec, reg.opt_opd1_sign), shape=(1, c, reg.opd1_h, reg.opd1_w), layout=Layout.compact, is_const=reg.opt_opd1_const) opd2 = dict(address=reg.opd2_addr, dtype=(reg.opt_opd0_prec, reg.opt_opd2_sign), shape=(1, c, 1, 1), layout=Layout.compact, is_const=reg.opt_opd2_const) opd3 = dict(address=reg.opd3_addr, dtype=(reg.opt_opd0_prec, reg.opt_opd0_sign), shape=(1, c, 1, 2), layout=Layout.compact, is_const=reg.opt_opd3_const) opd5 = dict(address=0, dtype=DType.si32, shape=(1, c, 1, 2), layout=Layout.compact, is_const=reg.opt_opd5_const) opds = [] if (reg.tsk_eu_typ in [0, 4, 3, 1]): if (reg.tsk_eu_typ == 0): opds = [opd0, opd1, opd2, opd3, opd5] elif (reg.tsk_eu_typ == 1): opds = [opd0, opd1, opd3, opd5] else: opds = [opd0, opd3, opd5] else: opd3['shape'] = (1, c, 1, 4) opd3['dtype'] = DType.ui16 if (reg.tsk_eu_typ in [5, 6]): opds = [opd0, opd1, opd2, opd3, opd5] else: opds = [opd0, opd2, opd3, opd5] attr = dict(kernel=[reg.opd1_h, reg.opd1_w], stride=[reg.res_op_y_str, reg.res_op_x_str], in_zero=[reg.opd0_y_ins0, reg.opd0_x_ins0], ke_zero=[reg.opd1_y_ins0, reg.opd1_x_ins0], opt_kernel_rotate=bool(reg.opt_kernel_rotate), pad_mode=reg.pad_mode, pad=[reg[f'opd0_{x}_pad'] for x in ('up', 'dn', 'lf', 'rt')], round_mode=reg.opd2_n_str, shift=np.uint32([reg.res1_addr]).view(np.int8)[0]) if (not bool(reg.opt_rq)): opds.remove(opd5) elif bool(reg.opt_opd5_const): opds.remove(opd5) attr['multiplier'] = tgcr.getter(6) attr['shift'] = int(np.binary_repr(tgcr.getter(32), width=32)[(- 8):(- 1)], 2) attr['yzp'] = int(np.binary_repr(tgcr.getter(33), width=32)[(- 16):(- 1)], 2) operands = [get_value(context, **x) for x in opds] results = [get_value(context, **res0)] return (results, attr, operands)
def prepare_dvoice(data_folder, save_folder, train_csv_file=None, dev_csv_file=None, test_csv_file=None, accented_letters=False, language='fongbe', skip_prep=False): if skip_prep: return if (train_csv_file is None): train_csv_file = (data_folder + 'texts/train.csv') else: train_csv_file = train_csv_file if (dev_csv_file is None): dev_csv_file = (data_folder + 'texts/dev.csv') else: dev_csv_file = dev_csv_file if (test_csv_file is None): test_csv_file = (data_folder + 'texts/test.csv') else: test_csv_file = test_csv_file if (not os.path.exists(save_folder)): os.makedirs(save_folder) ALFFA_LANGUAGES = ['amharic', 'fongbe', 'wolof'] if (language in ALFFA_LANGUAGES): df = alffa_public_prepare(language, data_folder) (train, dev, test) = train_validate_test_split(df) train.to_csv(f'{data_folder}/train.csv', index=False, sep='\t') dev.to_csv(f'{data_folder}/dev.csv', index=False, sep='\t') test.to_csv(f'{data_folder}/test.csv', index=False, sep='\t') if (language == 'swahili'): df = swahili_prepare(data_folder) (train, dev, test) = train_validate_test_split(df) train.to_csv(f'{data_folder}/train.csv', index=False, sep='\t') dev.to_csv(f'{data_folder}/dev.csv', index=False, sep='\t') test.to_csv(f'{data_folder}/test.csv', index=False, sep='\t') if (language == 'multilingual'): ALFFA_LANGUAGES = ['amharic', 'wolof'] df_alffa = pd.DataFrame() for lang in ALFFA_LANGUAGES: data_folder2 = (data_folder + f'/ALFFA_PUBLIC/ASR/{lang.upper()}/data') df_l = alffa_public_prepare(lang, data_folder2) df_l['wav'] = df_l['wav'].map((lambda x: (f'ALFFA_PUBLIC/ASR/{lang.upper()}/data/' + x.replace(f'{data_folder}/', '')))) df_alffa = pd.concat([df_alffa, df_l], ignore_index=True) df_sw = swahili_prepare(data_folder) train_darija = pd.read_csv(f'{data_folder}/DVOICE/darija/texts/train.csv', sep='\t') dev_darija = pd.read_csv(f'{data_folder}/DVOICE/darija/texts/dev.csv', sep='\t') test_darija = pd.read_csv(f'{data_folder}/DVOICE/darija/texts/test.csv', sep='\t') df_dar = pd.concat([train_darija, dev_darija, test_darija], ignore_index=True) df_dar['wav'] = df_dar['wav'].map((lambda x: ('DVOICE/darija/wavs/' + x))) df = pd.concat([df_alffa, df_sw, df_dar], ignore_index=True) (train, dev, test) = train_validate_test_split(df) train.to_csv(f'{data_folder}/train.csv', index=False, sep='\t') dev.to_csv(f'{data_folder}/dev.csv', index=False, sep='\t') test.to_csv(f'{data_folder}/test.csv', index=False, sep='\t') save_csv_train = (save_folder + '/train.csv') save_csv_dev = (save_folder + '/dev.csv') save_csv_test = (save_folder + '/test.csv') if skip(save_csv_train, save_csv_dev, save_csv_test): msg = ('%s already exists, skipping data preparation!' % save_csv_train) logger.info(msg) msg = ('%s already exists, skipping data preparation!' % save_csv_dev) logger.info(msg) msg = ('%s already exists, skipping data preparation!' % save_csv_test) logger.info(msg) return check_dvoice_folders(data_folder, language) if (train_csv_file is not None): create_csv(train_csv_file, save_csv_train, data_folder, accented_letters, language) if (dev_csv_file is not None): create_csv(dev_csv_file, save_csv_dev, data_folder, accented_letters, language) if (test_csv_file is not None): create_csv(test_csv_file, save_csv_test, data_folder, accented_letters, language)
def split_antimeridian_polygon(polygon: List[List[float]]) -> Tuple[(List, List)]: (poly1, poly2) = ([], []) split_loc = 0.0 has_split = False for idx in range((len(polygon) - 1)): first = polygon[idx] second = polygon[(idx + 1)] if (((abs(first[0]) < 180) and (abs(second[0]) > 180)) or ((abs(first[0]) > 180) and (abs(second[0]) < 180))): split_loc = math.copysign(180.0, first[0]) new_lat = np.interp([split_loc], np.array([first[0], second[0]]), np.array([first[1], second[1]]))[0] new_point = [split_loc, float(new_lat)] poly1.append([split_loc, float(new_lat)]) poly2.append([split_loc, float(new_lat)]) elif (abs(first[0]) < 180): poly1.append(first) else: poly2.append(first) poly1.append(poly1[0]) poly2.append(poly2[0]) poly2_wrapped: List[List[float]] = [] for point in poly2: if (split_loc > 0): poly2_wrapped.append([((- 180) + (point[0] - 180)), point[1]]) else: poly2_wrapped.append([(180 + (point[0] + 180)), point[1]]) mapping1 = shapely.geometry.mapping(shapely.geometry.Polygon(poly1)) mapping2 = shapely.geometry.mapping(shapely.geometry.polygon.orient(shapely.geometry.Polygon(poly2_wrapped), 1.0)) return (mapping1, mapping2)
.parametrize('delta', [0.1, 0.2]) def test_ltt_different_delta(delta: float) -> None: assert ltt_procedure(r_hat, alpha, delta, n)
def test_case_6(): int_0 = 1187 queue_0 = module_0.Queue(int_0) assert (f'{type(queue_0).__module__}.{type(queue_0).__qualname__}' == 'queue_example.Queue') assert (queue_0.max == 1187) assert (queue_0.head == 0) assert (queue_0.tail == 0) assert (queue_0.size == 0) assert (f'{type(queue_0.data).__module__}.{type(queue_0.data).__qualname__}' == 'array.array') assert (len(queue_0.data) == 1187) bool_0 = queue_0.empty() assert (bool_0 is False) bool_1 = queue_0.enqueue(int_0) assert (bool_1 is True) assert (queue_0.tail == 1) assert (queue_0.size == 1) queue_1 = module_0.Queue(bool_1) assert (f'{type(queue_1).__module__}.{type(queue_1).__qualname__}' == 'queue_example.Queue') assert (queue_1.max is True) assert (queue_1.head == 0) assert (queue_1.tail == 0) assert (queue_1.size == 0) assert (f'{type(queue_1.data).__module__}.{type(queue_1.data).__qualname__}' == 'array.array') assert (len(queue_1.data) == 1) bool_2 = queue_1.full() assert (bool_2 is False) int_1 = 1441 bool_3 = queue_1.enqueue(int_1) assert (bool_3 is True) assert (queue_1.size == 1) bool_4 = queue_1.full() assert (bool_4 is True) int_2 = 1080 queue_2 = module_0.Queue(int_2) assert (queue_2.head == 0) assert (queue_2.size == 0) bool_5 = queue_1.full() assert (bool_5 is True) queue_3 = module_0.Queue(bool_5) assert (f'{type(queue_3).__module__}.{type(queue_3).__qualname__}' == 'queue_example.Queue') assert (queue_3.max is True) assert (queue_3.head == 0) assert (queue_3.tail == 0) assert (queue_3.size == 0) assert (f'{type(queue_3.data).__module__}.{type(queue_3.data).__qualname__}' == 'array.array') assert (len(queue_3.data) == 1) bool_6 = queue_3.empty() assert (bool_6 is False) bool_7 = queue_1.enqueue(bool_2) bool_8 = queue_1.empty() assert (bool_8 is True) none_type_0 = queue_2.dequeue() none_type_1 = queue_3.dequeue() queue_4 = module_0.Queue(bool_4) assert (queue_4.head == 0) assert (queue_4.size == 0) bool_9 = queue_4.empty() assert (bool_9 is False) int_3 = 2245 bool_10 = queue_2.empty() assert (bool_10 is False) bool_11 = queue_3.empty() assert (bool_11 is False) bool_12 = queue_0.full() queue_5 = module_0.Queue(int_3) assert (queue_5.head == 0) assert (queue_5.size == 0) int_4 = queue_0.dequeue() assert (int_4 == 1187) assert (queue_0.head == 1) assert (queue_0.size == 0) bool_13 = queue_3.empty() assert (bool_13 is False) none_type_2 = queue_4.dequeue() int_5 = 481 queue_6 = module_0.Queue(int_5) assert (queue_6.head == 0) assert (queue_6.size == 0) none_type_3 = queue_3.dequeue() bool_14 = queue_6.enqueue(bool_4) assert (queue_6.tail == 1) assert (queue_6.size == 1) none_type_4 = queue_3.dequeue() bool_15 = queue_0.empty() assert (bool_15 is False) bool_16 = queue_3.full()
class MobileCRNN(nn.Module): def __init__(self, inputdim, outputdim, **kwargs): super().__init__() filters = ([1] + kwargs.get('filters', ([40] + ([160] * 5)))) kernels = kwargs.get('kernels', ([5] + ([3] * 5))) paddings = kwargs.get('padding', ([2] + ([1] * 5))) strides = kwargs.get('strides', ([2] + ([1] * 5))) poolings = kwargs.get('pooling', (([(2, 4)] + ([(1, 2)] * 3)) + ([(1, 1)] * 2))) features = nn.ModuleList() for (h0, h1, kernel_size, padding, pooling, stride) in zip(filters, filters[1:], kernels, paddings, poolings, strides): if (h0 == 1): features.append(nn.Sequential(nn.BatchNorm2d(h0), nn.Conv2d(h0, h1, kernel_size=kernel_size, padding=padding, stride=stride), Swish())) else: features.append(InvertedResidual(h0, h1, 1, expand_ratio=6)) if (np.prod(pooling) > 1): features.append(nn.MaxPool2d(pooling)) self.features = nn.Sequential(*features) with torch.no_grad(): rnn_input_dim = self.features(torch.randn(1, 1, 500, inputdim)).shape rnn_input_dim = (rnn_input_dim[1] * rnn_input_dim[(- 1)]) self.gru = BiGRU(inputdim=rnn_input_dim, outputdim=128) self.temp_pool = parse_poolingfunction(kwargs.get('temppool', 'linear'), inputdim=int(256), outputdim=outputdim) self.outputlayer = nn.Linear(256, outputdim) def forward(self, x, mode='all'): if (mode == 'all'): x = x.unsqueeze(1) x = self.features(x) x = x.transpose(1, 2).contiguous().flatten((- 2)) (x, _) = self.gru(x) decision_time = torch.sigmoid(self.outputlayer(x)) decision_time = torch.clamp(decision_time, min=1e-07, max=1.0) decision = self.temp_pool(x, decision_time).squeeze(1) decision = torch.clamp(decision, min=1e-07, max=1.0) return (decision, decision_time) if (mode == 'embed'): x = x.unsqueeze(1) x = self.features(x) return x elif (mode == 'cont'): x = x.transpose(1, 2).contiguous().flatten((- 2)) (x, _) = self.gru(x) decision_time = torch.sigmoid(self.outputlayer(x)) decision_time = torch.clamp(decision_time, min=1e-07, max=1.0) decision = self.temp_pool(x, decision_time).squeeze(1) decision = torch.clamp(decision, min=1e-07, max=1.0) return (decision, decision_time)
def build_transform(is_train, args): mean = IMAGENET_DEFAULT_MEAN std = IMAGENET_DEFAULT_STD if is_train: transform = create_transform(input_size=args.input_size, is_training=True, color_jitter=False, auto_augment='rand-m9-mstd0.5-inc1', interpolation='bicubic', mean=mean, std=std) return transform t = [] if (args.input_size <= 224): crop_pct = (224 / 256) else: crop_pct = 1.0 size = int((args.input_size / crop_pct)) t.append(transforms.Resize(size, interpolation=PIL.Image.BICUBIC)) t.append(transforms.CenterCrop(args.input_size)) t.append(transforms.ToTensor()) t.append(transforms.Normalize(mean, std)) return transforms.Compose(t)
def get_grand_parent_dir(f_name): from pathlib import Path if ('.' in f_name.split('/')[(- 1)]): return get_grand_parent_dir(get_dir_of_file(f_name)) else: return f'{Path(f_name).parent}/'
def proceed(prompt, allowed_chars, error_prompt=None, default=None): p = prompt while True: s = raw_input(p) p = prompt if ((not s) and default): s = default if s: c = s[0].lower() if (c in allowed_chars): break if error_prompt: p = ('%c: %s\n%s' % (c, error_prompt, prompt)) return c
def my_nested_rref_add(dst, rref_t1, t2): return rpc.rpc_sync(dst, my_rref_add, args=(rref_t1, t2))
def check_train_pairs(raw_data, direction, all_test_data, mess_up_train={}): (src, tgt) = direction.split('-') path1 = f'{raw_data}/train.{src}-{tgt}.{src}' path2 = f'{raw_data}/train.{src}-{tgt}.{tgt}' if ((not os.path.exists(path1)) or (not os.path.exists(path2))): return with open(path1) as f1, open(path2) as f2: for (src_line, tgt_line) in zip(f1, f2): s = src_line.strip() t = tgt_line.strip() if (((s, t) in all_test_data) or ((t, s) in all_test_data)): langs = mess_up_train.get((s, t), set()) langs.add(src) langs.add(tgt) mess_up_train[(s, t)] = langs
def split_header(task, lines): if (task in ['CoLA']): return ([], lines) elif (task in ['MNLI', 'MRPC', 'QNLI', 'QQP', 'RTE', 'SNLI', 'SST-2', 'STS-B', 'WNLI']): return (lines[0:1], lines[1:]) else: raise ValueError('Unknown GLUE task.')
class SemistandardSkewTableaux(SkewTableaux): def __classcall_private__(cls, p=None, mu=None, max_entry=None): if (p is None): if (mu is None): return SemistandardSkewTableaux_all(max_entry) raise ValueError('you must specify either a size or a shape') if isinstance(p, (int, Integer)): if (mu is None): return SemistandardSkewTableaux_size(p, max_entry) else: return SemistandardSkewTableaux_size_weight(p, mu) if (p in SkewPartitions()): if (mu is None): return SemistandardSkewTableaux_shape(p, max_entry) else: return SemistandardSkewTableaux_shape_weight(p, mu) raise ValueError('invalid input') def __contains__(self, x): if (x not in SkewTableaux()): return False try: x = self.element_class(self, x) except Exception: return False return x.is_semistandard()
_deepspeed _torch_gpu class TrainerIntegrationDeepSpeed(TrainerIntegrationDeepSpeedWithCustomConfig, TrainerIntegrationCommon): def test_hf_ds_config_mismatch(self): ds_config = self.get_config_dict(ZERO2) per_device_train_batch_size = 2 ds_config['train_micro_batch_size_per_gpu'] = (per_device_train_batch_size + 2) ds_config['train_batch_size'] = 1000 gradient_accumulation_steps = 2 ds_config['gradient_accumulation_steps'] = (gradient_accumulation_steps + 2) max_grad_norm = 1.0 ds_config['gradient_clipping'] = (max_grad_norm + 0.1) (adam_beta1, adam_beta2) = (0.9, 0.99) ds_config['optimizer']['params']['betas'] = [(adam_beta1 - 0.1), (adam_beta2 - 0.1)] fp16 = True ds_config['fp16']['enabled'] = (not fp16) keys = ['per_device_train_batch_size', 'train_batch_size', 'gradient_accumulation_steps', 'max_grad_norm', 'betas', 'fp16'] with mockenv_context(**self.dist_env_1_gpu): trainer = get_regression_trainer(local_rank=0, fp16=fp16, deepspeed=ds_config, per_device_train_batch_size=per_device_train_batch_size, gradient_accumulation_steps=gradient_accumulation_steps, max_grad_norm=max_grad_norm, adam_beta1=adam_beta1, adam_beta2=adam_beta2) with self.assertRaises(Exception) as context: trainer.train() for key in keys: self.assertTrue((key in str(context.exception)), f'''{key} is not in the exception message: {context.exception}''') def test_hf_scheduler_hf_optimizer(self): a = 0 with mockenv_context(**self.dist_env_1_gpu): ds_config_zero2_dict = self.get_config_dict(ZERO2) del ds_config_zero2_dict['optimizer'] del ds_config_zero2_dict['scheduler'] ds_config_zero2_dict['zero_optimization']['offload_optimizer']['device'] = 'none' ds_config_zero2_dict['fp16']['initial_scale_power'] = 1 trainer = get_regression_trainer(a=a, local_rank=0, fp16=True, deepspeed=ds_config_zero2_dict) trainer.train() new_a = trainer.model.a.item() self.assertNotEqual(new_a, a) def test_ds_scheduler_hf_optimizer(self): a = 0 with mockenv_context(**self.dist_env_1_gpu): ds_config_zero2_dict = self.get_config_dict(ZERO2) del ds_config_zero2_dict['optimizer'] ds_config_zero2_dict['zero_optimization']['offload_optimizer']['device'] = 'none' ds_config_zero2_dict['fp16']['initial_scale_power'] = 1 trainer = get_regression_trainer(a=a, local_rank=0, fp16=True, deepspeed=ds_config_zero2_dict) trainer.train() new_a = trainer.model.a.item() self.assertNotEqual(new_a, a) def test_hf_scheduler_ds_optimizer(self): a = 0 with mockenv_context(**self.dist_env_1_gpu): ds_config_zero2_dict = self.get_config_dict(ZERO2) del ds_config_zero2_dict['scheduler'] ds_config_zero2_dict['zero_optimization']['offload_optimizer']['device'] = 'none' ds_config_zero2_dict['fp16']['initial_scale_power'] = 1 trainer = get_regression_trainer(local_rank=0, fp16=True, deepspeed=ds_config_zero2_dict) trainer.train() new_a = trainer.model.a.item() self.assertNotEqual(new_a, a) _deepspeed_aio def test_stage3_nvme_offload(self): with mockenv_context(**self.dist_env_1_gpu): nvme_path = self.get_auto_remove_tmp_dir() nvme_config = {'device': 'nvme', 'nvme_path': nvme_path} ds_config_zero3_dict = self.get_config_dict(ZERO3) ds_config_zero3_dict['zero_optimization']['offload_optimizer'] = nvme_config ds_config_zero3_dict['zero_optimization']['offload_param'] = nvme_config trainer = get_regression_trainer(local_rank=0, fp16=True, deepspeed=ds_config_zero3_dict) with CaptureLogger(deepspeed_logger) as cl: trainer.train() self.assertIn('DeepSpeed info', cl.out, 'expected DeepSpeed logger output but got none') _optuna def test_hyperparameter_search(self): with mockenv_context(**self.dist_env_1_gpu): ds_config_zero3_dict = self.get_config_dict(ZERO3) def model_init(): config = RegressionModelConfig(a=0, b=0, double_output=False) model = RegressionPreTrainedModel(config) return model trainer = get_regression_trainer(local_rank=0, fp16=True, model_init=model_init, deepspeed=ds_config_zero3_dict) n_trials = 3 with CaptureLogger(deepspeed_logger) as cl: with CaptureStd() as cs: trainer.hyperparameter_search(direction='maximize', n_trials=n_trials) self.assertIn('DeepSpeed info', cl.out, 'expected DeepSpeed logger output but got none') self.assertIn(f'Trial {(n_trials - 1)} finished with value', cs.err, 'expected hyperparameter_search output') self.assertIn('Best is trial', cs.err, 'expected hyperparameter_search output') (params, name_func=parameterized_custom_name_func) def test_hf_optimizer_with_offload(self, stage, dtype): ds_config_dict = self.get_config_dict(stage) del ds_config_dict['optimizer'] ds_config_dict['zero_optimization']['offload_optimizer']['device'] = 'cpu' ds_config_dict['zero_force_ds_cpu_optimizer'] = False with mockenv_context(**self.dist_env_1_gpu): kwargs = {'local_rank': 0, 'deepspeed': ds_config_dict} kwargs[dtype] = True trainer = get_regression_trainer(**kwargs) with CaptureLogger(deepspeed_logger) as cl: trainer.train() self.assertIn('DeepSpeed info', cl.out, 'expected DeepSpeed logger output but got none') (params, name_func=parameterized_custom_name_func) def test_fake_notebook_no_launcher(self, stage, dtype): with mockenv_context(**self.dist_env_1_gpu): kwargs = {'local_rank': 0, 'deepspeed': self.get_config_dict(stage)} kwargs[dtype] = True trainer = get_regression_trainer(**kwargs) with CaptureLogger(deepspeed_logger) as cl: trainer.train() self.assertIn('DeepSpeed info', cl.out, 'expected DeepSpeed logger output but got none') (params, name_func=parameterized_custom_name_func) def test_early_get_last_lr(self, stage, dtype): with mockenv_context(**self.dist_env_1_gpu): a = b = 0.0 kwargs = {'a': a, 'b': b, 'local_rank': 0, 'train_len': 8, 'deepspeed': self.get_config_dict(stage), 'per_device_train_batch_size': 8, 'logging_steps': 1} kwargs[dtype] = True trainer = get_regression_trainer(**kwargs) trainer.train() post_train_a = trainer.model.a.item() if (((stage == ZERO3) and (dtype == FP16)) or (dtype == BF16)): return self.assertEqual(post_train_a, a) (params, name_func=parameterized_custom_name_func) def test_gradient_accumulation(self, stage, dtype): train_len = 64 a = b = 0.0 kwargs = {'a': a, 'b': b, 'local_rank': 0, 'train_len': train_len, 'deepspeed': self.get_config_dict(stage)} kwargs[dtype] = True with mockenv_context(**self.dist_env_1_gpu): no_grad_accum_trainer = get_regression_trainer(**kwargs, per_device_train_batch_size=16, gradient_accumulation_steps=1) no_grad_accum_result = no_grad_accum_trainer.train() no_grad_accum_loss = no_grad_accum_result.training_loss no_grad_accum_a = no_grad_accum_trainer.model.a.item() no_grad_accum_b = no_grad_accum_trainer.model.b.item() self.assertNotEqual(no_grad_accum_a, a) with mockenv_context(**self.dist_env_1_gpu): yes_grad_accum_trainer = get_regression_trainer(**kwargs, per_device_train_batch_size=4, gradient_accumulation_steps=4) yes_grad_accum_result = yes_grad_accum_trainer.train() yes_grad_accum_loss = yes_grad_accum_result.training_loss yes_grad_accum_a = yes_grad_accum_trainer.model.a.item() yes_grad_accum_b = yes_grad_accum_trainer.model.b.item() self.assertNotEqual(yes_grad_accum_a, a) self.assertAlmostEqual(no_grad_accum_a, yes_grad_accum_a, places=5) self.assertAlmostEqual(no_grad_accum_b, yes_grad_accum_b, places=5) self.assertAlmostEqual(no_grad_accum_loss, yes_grad_accum_loss, places=2) def check_saved_checkpoints_deepspeed(self, output_dir, freq, total, stage, dtype): file_list = [WEIGHTS_NAME, 'training_args.bin', 'trainer_state.json', 'config.json'] if (stage == ZERO2): ds_file_list = ['mp_rank_00_model_states.pt'] elif (stage == ZERO3): ds_file_list = ['zero_pp_rank_0_mp_rank_00_model_states.pt'] else: raise ValueError(f'unknown stage {stage}') if (dtype == 'bf16'): ds_file_list.append('bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt') for step in range(freq, total, freq): checkpoint = os.path.join(output_dir, f'checkpoint-{step}') self.assertTrue(os.path.isdir(checkpoint), f'[{stage}] {checkpoint} dir is not found') for filename in file_list: path = os.path.join(checkpoint, filename) self.assertTrue(os.path.isfile(path), f'[{stage}] {path} is not found') ds_path = os.path.join(checkpoint, f'global_step{step}') for filename in ds_file_list: path = os.path.join(ds_path, filename) self.assertTrue(os.path.isfile(path), f'[{stage}] {path} is not found') (params, name_func=parameterized_custom_name_func) def test_save_checkpoints(self, stage, dtype): freq = 5 output_dir = self.get_auto_remove_tmp_dir() ds_config_dict = self.get_config_dict(stage) if (dtype == FP16): ds_config_dict['fp16']['initial_scale_power'] = 1 if (stage == ZERO3): ds_config_dict['zero_optimization']['stage3_gather_16bit_weights_on_model_save'] = True with mockenv_context(**self.dist_env_1_gpu): kwargs = {'output_dir': output_dir, 'save_steps': freq, 'deepspeed': ds_config_dict} kwargs[dtype] = True trainer = get_regression_trainer(**kwargs) trainer.train() total = int(((self.n_epochs * 64) / self.batch_size)) self.check_saved_checkpoints_deepspeed(output_dir, freq, total, stage, dtype) (params, name_func=parameterized_custom_name_func) def test_can_resume_training_errors(self, stage, dtype): with mockenv_context(**self.dist_env_1_gpu): ds_config_dict = self.get_config_dict(stage) output_dir = self.get_auto_remove_tmp_dir() kwargs = {'output_dir': output_dir, 'deepspeed': ds_config_dict} kwargs[dtype] = True trainer = get_regression_trainer(**kwargs) with self.assertRaises(Exception) as context: trainer.train(resume_from_checkpoint=True) self.assertTrue(('No valid checkpoint found in output directory' in str(context.exception)), f'got exception: {context.exception}') with self.assertRaises(Exception) as context: checkpoint = os.path.join(output_dir, 'checkpoint-5') trainer.train(resume_from_checkpoint=f'{checkpoint}-bogus') self.assertTrue(("Can't find a valid checkpoint at" in str(context.exception)), f'got exception: {context.exception}') (params, name_func=parameterized_custom_name_func) def test_can_resume_training_normal(self, stage, dtype): output_dir = self.get_auto_remove_tmp_dir('./xxx', after=False) ds_config_dict = self.get_config_dict(stage) if (dtype == FP16): ds_config_dict['fp16']['initial_scale_power'] = 1 if (stage == ZERO3): ds_config_dict['zero_optimization']['stage3_gather_16bit_weights_on_model_save'] = True kwargs = {'output_dir': output_dir, 'train_len': 128, 'save_steps': 5, 'learning_rate': 0.1, 'deepspeed': ds_config_dict} kwargs[dtype] = True with mockenv_context(**self.dist_env_1_gpu): trainer = get_regression_trainer(**kwargs) trainer.train() (a, b) = (trainer.model.a.item(), trainer.model.b.item()) state = dataclasses.asdict(trainer.state) checkpoint = os.path.join(output_dir, 'checkpoint-5') trainer = get_regression_trainer(**kwargs) trainer.train(resume_from_checkpoint=checkpoint) (a1, b1) = (trainer.model.a.item(), trainer.model.b.item()) state1 = dataclasses.asdict(trainer.state) self.assertEqual(a, a1) self.assertEqual(b, b1) self.check_trainer_state_are_the_same(state, state1) checkpoint = os.path.join(output_dir, 'checkpoint-15') trainer = get_regression_trainer(**kwargs) trainer.train(resume_from_checkpoint=checkpoint) (a1, b1) = (trainer.model.a.item(), trainer.model.b.item()) state1 = dataclasses.asdict(trainer.state) self.assertEqual(a, a1) self.assertEqual(b, b1) self.check_trainer_state_are_the_same(state, state1) (params, name_func=parameterized_custom_name_func) def test_load_state_dict_from_zero_checkpoint(self, stage, dtype): output_dir = self.get_auto_remove_tmp_dir() ds_config_dict = self.get_config_dict(stage) kwargs = {'output_dir': output_dir, 'train_len': 4, 'per_device_train_batch_size': 4, 'num_train_epochs': 1, 'save_strategy': 'steps', 'save_steps': 1, 'learning_rate': 0.1, 'deepspeed': ds_config_dict} kwargs[dtype] = True with mockenv_context(**self.dist_env_1_gpu): trainer = get_regression_trainer(**kwargs) trainer.train() (a, b) = (trainer.model.a.item(), trainer.model.b.item()) state = dataclasses.asdict(trainer.state) checkpoint_dir = get_last_checkpoint(output_dir) model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir) (a1, b1) = (model.a.item(), model.b.item()) state1 = dataclasses.asdict(trainer.state) self.assertEqual(a, a1) self.assertEqual(b, b1) self.check_trainer_state_are_the_same(state, state1) def test_config_object(self): output_dir = self.get_auto_remove_tmp_dir() kwargs = {'output_dir': output_dir, 'train_len': 8, 'fp16': True} ds_config_zero3_dict = self.get_config_dict(ZERO3) ds_config_zero2_dict = self.get_config_dict(ZERO2) with mockenv_context(**self.dist_env_1_gpu): trainer = get_regression_trainer(deepspeed=ds_config_zero3_dict, **kwargs) self.assertTrue(is_deepspeed_zero3_enabled()) trainer = get_regression_trainer(deepspeed=ds_config_zero3_dict, **kwargs) trainer.train() self.assertTrue(is_deepspeed_zero3_enabled()) trainer = get_regression_trainer(deepspeed=ds_config_zero2_dict, **kwargs) self.assertFalse(is_deepspeed_zero3_enabled()) config = deepspeed_config() self.assertTrue(bool(config), 'Deepspeed config should be accessible') del trainer config = deepspeed_config() self.assertFalse(is_deepspeed_zero3_enabled()) self.assertFalse(bool(config), 'Deepspeed config should not be accessible') (params, name_func=parameterized_custom_name_func) def test_load_best_model(self, stage, dtype): from transformers import T5ForConditionalGeneration, T5Tokenizer, Trainer output_dir = self.get_auto_remove_tmp_dir() ds_config_dict = self.get_config_dict(stage) del ds_config_dict['optimizer'] del ds_config_dict['scheduler'] ds_config_dict['zero_force_ds_cpu_optimizer'] = False ds_config_dict['zero_optimization']['stage3_gather_16bit_weights_on_model_save'] = True with mockenv_context(**self.dist_env_1_gpu): args_dict = {'per_gpu_train_batch_size': 1, 'per_gpu_eval_batch_size': 1, 'gradient_accumulation_steps': 1, 'learning_rate': 0.0001, 'num_train_epochs': 1, 'do_train': True, 'do_eval': True, 'optim': 'adafactor', 'evaluation_strategy': 'steps', 'eval_steps': 1, 'save_strategy': 'steps', 'save_steps': 1, 'load_best_model_at_end': True, 'max_steps': 1, 'deepspeed': ds_config_dict, 'report_to': 'none'} training_args = TrainingArguments(output_dir, **args_dict) tokenizer = T5Tokenizer.from_pretrained(T5_TINY) model = T5ForConditionalGeneration.from_pretrained(T5_TINY) def _add_eos_to_examples(example): example['input_text'] = f"question: {example['question']} context: {example['context']}" example['target_text'] = (example['answers']['text'][0] if (len(example['answers']['text']) > 0) else '') return example def _convert_to_features(example_batch): input_encodings = tokenizer.batch_encode_plus(example_batch['input_text'], pad_to_max_length=True, max_length=512, truncation=True) target_encodings = tokenizer.batch_encode_plus(example_batch['target_text'], pad_to_max_length=True, max_length=16, truncation=True) encodings = {'input_ids': input_encodings['input_ids'], 'attention_mask': input_encodings['attention_mask'], 'labels': target_encodings['input_ids']} return encodings def get_dataset(): data_file = str((self.tests_dir / 'fixtures/tests_samples/SQUAD/sample.json')) data_files = {'train': data_file, 'validation': data_file} raw_datasets = datasets.load_dataset('json', data_files=data_files, field='data') train_dataset = raw_datasets['train'].map(_add_eos_to_examples).map(_convert_to_features, batched=True) valid_dataset = deepcopy(train_dataset) return (train_dataset, valid_dataset) (train_dataset, eval_dataset) = get_dataset() trainer = Trainer(model=model, tokenizer=tokenizer, args=training_args, train_dataset=train_dataset, eval_dataset=eval_dataset) trainer.train() trainer.evaluate()
def read_index(path): data = [] for line in open(path, 'r', encoding='UTF-8'): line = line.replace('\n', '') data.append(line) return data
def set_pp_option(k, v): if (k == 'html_mode'): if v: set_html_mode(True) else: set_html_mode(False) return True if (k == 'fpa_pretty'): if v: set_fpa_pretty(True) else: set_fpa_pretty(False) return True val = getattr(_PP, k, None) if (val is not None): _z3_assert(isinstance(v, type(val)), 'Invalid pretty print option value') setattr(_PP, k, v) return True val = getattr(_Formatter, k, None) if (val is not None): _z3_assert(isinstance(v, type(val)), 'Invalid pretty print option value') setattr(_Formatter, k, v) return True return False
def search_concept_net(keyword): keyword = keyword.lower().replace(' ', '_') neighbors = [] for relation in extracted_concept_net: if ((relation in BANNED_RELATIONS) or (keyword not in extracted_concept_net[relation])): continue for (h0, h1, weight) in extracted_concept_net[relation][keyword]: if (h0 == h1 == keyword): continue neighbors.append({'entity': (h0 if (h1 == keyword) else h1), 'reasoning': f'ConceptNet: [[{h0}]] {relation} [[{h1}]]', 'relation_weight': weight}) for i in range(len(neighbors)): neighbors[i]['entity'] = neighbors[i]['entity'].replace('_', ' ') return neighbors
class PhysicalQuantity(float): def __new__(cls, value): return float.__new__(cls, value) def __add__(self, x): assert_(isinstance(x, PhysicalQuantity)) return PhysicalQuantity((float(x) + float(self))) __radd__ = __add__ def __sub__(self, x): assert_(isinstance(x, PhysicalQuantity)) return PhysicalQuantity((float(self) - float(x))) def __rsub__(self, x): assert_(isinstance(x, PhysicalQuantity)) return PhysicalQuantity((float(x) - float(self))) def __mul__(self, x): return PhysicalQuantity((float(x) * float(self))) __rmul__ = __mul__ def __div__(self, x): return PhysicalQuantity((float(self) / float(x))) def __rdiv__(self, x): return PhysicalQuantity((float(x) / float(self)))
class CodeReference(Reference): test_cases: Optional[Dict] = None def __init__(self, test_cases=None, **kw): self.test_cases = test_cases super(CodeReference, self).__init__(**kw)
class CymruIpOriginService(Service): __records: List[str] __dns: DomainNameService def __init__(self): super().__init__() self.__records = [] self.addDependency('DomainNameService', True, True) self.addDependency('Base', False, False) def _createServer(self) -> Server: return CymruIpOriginServer() def getName(self) -> str: return 'CymruIpOriginService' def addMapping(self, prefix: str, asn: int) -> CymruIpOriginService: [pfx, cidr] = prefix.split('/') cidr = int(cidr) assert (cidr <= 24), 'Invalid prefix.' prefix = IPv4Network(prefix) sub_cidr = 24 num_8s = 3 if (cidr >= 0): sub_cidr = 8 num_8s = 1 if (cidr >= 9): sub_cidr = 16 num_8s = 2 if (cidr >= 17): sub_cidr = 24 num_8s = 3 for net in prefix.subnets(new_prefix=sub_cidr): record = '*.' record += '.'.join(reversed(str(net).split('.')[0:3])) record += '.origin.asn TXT "{} | {} | ZZ | SEED | 0000-00-00"'.format(asn, net) self.__records.append(record) return self def getRecords(self) -> List[str]: return self.__records def addRecord(self, record: str) -> CymruIpOriginService: self.__records.append(record) return self def _doInstall(self, node: Node, server: Server): assert False, 'CymruIpOriginService is not a real service and should not be installed this way. Please install a DomainNameService on the node and host the zone "cymru.com." yourself.' def configure(self, emulator: Emulator): reg = emulator.getRegistry() mappings: List[Tuple[(str, str)]] = [] self._log('Collecting all networks in the simulation...') for regobj in reg.getAll().items(): [(asn, type, name), obj] = regobj if (type != 'net'): continue net: Network = obj if (asn == 'ix'): asn = name.replace('ix', '') asn_val = 0 try: asn_val = int(asn) except ValueError: asn_val = 0 mappings.append((net.getPrefix(), asn_val)) for mapping in mappings: (prefix, asn) = mapping self.addMapping(str(prefix), asn) self._log('Creating "cymru.com." zone...') dns: DomainNameService = reg.get('seedemu', 'layer', 'DomainNameService') zone = dns.getZone('cymru.com.') self.__dns = dns self._log('Adding mappings...') for record in self.__records: zone.addRecord(record) return super().configure(emulator) def print(self, indent: int) -> str: out = (' ' * indent) out += 'CymruIpOriginService\n' return out
class BasicDecoder(nn.Module): def __init__(self, insize, outsize, kernel=3, init_stride=1, pad=1, last_layer=False): super().__init__() self.last_layer = last_layer self.baseconv = nn.Sequential(nn.Conv3d(insize, insize, kernel_size=kernel, stride=init_stride, padding=pad), nn.InstanceNorm3d(insize), nn.LeakyReLU(inplace=True)) self.conv1x1 = nn.Conv3d(insize, outsize, kernel_size=1, stride=1, padding=0) self.upconv = nn.Sequential(nn.InstanceNorm3d(outsize), nn.LeakyReLU(inplace=True), nn.Upsample(scale_factor=2, mode='nearest'), nn.Conv3d(outsize, outsize, kernel_size=3, stride=1, padding=1), nn.InstanceNorm3d(outsize), nn.LeakyReLU(inplace=True)) self.upconv_lastlayer = nn.Sequential(nn.Conv3d(insize, outsize, kernel_size=kernel, stride=init_stride, padding=pad), nn.InstanceNorm3d(outsize), nn.LeakyReLU(inplace=True)) for m in self.children(): if isinstance(m, nn.Conv3d): init_weights(m, init_type='kaiming') def forward(self, x): if (self.last_layer == False): out = self.baseconv(x) out = self.conv1x1(out) out = self.upconv(out) return out else: return self.upconv_lastlayer(x)
def standardize(x, axis, eps): x = (x - jnp.mean(x, axis=axis, keepdims=True)) x = (x / jnp.sqrt((jnp.mean(jnp.square(x), axis=axis, keepdims=True) + eps))) return x
def generate_parameter_list(node_args, node_kwargs, ready_expressions, should_inject_device=False, string=True): has_device_arg = any(((a.value_type is torch.device) for a in node_args)) has_device_arg |= any(((a.value_type is torch.device) for a in node_kwargs.keys())) args = [ready_expressions[a] for a in node_args] kwargs = [] for (a, kws) in node_kwargs.items(): for k in kws: kwargs.append(f'{k}={ready_expressions[a]}') if (should_inject_device and (not has_device_arg)): kwargs.append('device=self.device') if string: return ', '.join((args + kwargs)) return (args + kwargs)
def start_master(port: int=None, config: Config=None, config_path: str=None, block: bool=False, watchdog: bool=True, no_workers_timeout: float=30, new_job_retries_limit: int=5): config = (config or Config(config_path)) port = (port or config.master_port) db = bindings.Database(config.storage_config, config.db_path, ((config.master_address + ':') + port)) result = bindings.start_master(db, port, SCRIPT_DIR, watchdog, no_workers_timeout, new_job_retries_limit) if (not result.success()): raise ScannerException('Failed to start master: {}'.format(result.msg())) if block: bindings.wait_for_server_shutdown(db) return db
def sym_norm(adj): if isinstance(adj, torch_sparse.SparseTensor): adj_t = gcn_norm(adj, add_self_loops=True) return adj_t
class BootstrapFewShotWithRandomSearch(Teleprompter): def __init__(self, metric, teacher_settings={}, max_bootstrapped_demos=4, max_labeled_demos=16, max_rounds=1, num_candidate_programs=16, num_threads=6, stop_at_score=None): self.metric = metric self.teacher_settings = teacher_settings self.max_rounds = max_rounds self.num_threads = num_threads self.stop_at_score = stop_at_score self.min_num_samples = 1 self.max_num_samples = max_bootstrapped_demos self.num_candidate_sets = num_candidate_programs self.max_labeled_demos = max_labeled_demos print('Going to sample between', self.min_num_samples, 'and', self.max_num_samples, 'traces per predictor.') print('Will attempt to train', self.num_candidate_sets, 'candidate sets.') def compile(self, student, *, teacher=None, trainset, valset=None, restrict=None): self.trainset = trainset self.valset = (valset or trainset) scores = [] all_subscores = [] score_data = [] for seed in range((- 3), self.num_candidate_sets): if ((restrict is not None) and (seed not in restrict)): print(seed, restrict) continue trainset2 = list(self.trainset) if (seed == (- 3)): program2 = student.reset_copy() elif (seed == (- 2)): teleprompter = LabeledFewShot(k=self.max_labeled_demos) program2 = teleprompter.compile(student, trainset=trainset2) elif (seed == (- 1)): program = BootstrapFewShot(metric=self.metric, max_bootstrapped_demos=self.max_num_samples, max_labeled_demos=self.max_labeled_demos, teacher_settings=self.teacher_settings, max_rounds=self.max_rounds) program2 = program.compile(student, teacher=teacher, trainset=trainset2) else: assert (seed >= 0), seed random.Random(seed).shuffle(trainset2) size = random.Random(seed).randint(self.min_num_samples, self.max_num_samples) teleprompter = BootstrapFewShot(metric=self.metric, max_bootstrapped_demos=size, max_labeled_demos=self.max_labeled_demos, teacher_settings=self.teacher_settings, max_rounds=self.max_rounds) program2 = teleprompter.compile(student, teacher=teacher, trainset=trainset2) evaluate = Evaluate(devset=self.valset, metric=self.metric, num_threads=self.num_threads, display_table=False, display_progress=True) (score, subscores) = evaluate(program2, return_all_scores=True) all_subscores.append(subscores) print('Score:', score, 'for set:', [len(predictor.demos) for predictor in program2.predictors()]) if ((len(scores) == 0) or (score > max(scores))): print('New best score:', score, 'for seed', seed) best_program = program2 scores.append(score) print(f'Scores so far: {scores}') print('Best score:', max(scores)) score_data.append((score, subscores, seed, program2)) if (len(score_data) > 2): for k in [1, 2, 3, 5, 8, 9999]: top_3_scores = sorted(score_data, key=(lambda x: x[0]), reverse=True)[:k] transposed_subscores = zip(*[subscores for (_, subscores, *_) in top_3_scores if subscores]) avg_of_max_per_entry = (sum((max(entry) for entry in transposed_subscores)) / len(top_3_scores[0][1])) print(f'Average of max per entry across top {k} scores: {avg_of_max_per_entry}') if ((self.stop_at_score is not None) and (score >= self.stop_at_score)): print(f'Stopping early because score {score} is >= stop_at_score {self.stop_at_score}') break best_program.candidate_programs = score_data best_program.candidate_programs = sorted(best_program.candidate_programs, key=(lambda x: x[0]), reverse=True) print(len(best_program.candidate_programs), 'candidate programs found.') return best_program
def test_unknown_reference(): config = {'param1': Ref('param2')} pipeline = Pipeline(config) with pytest.raises(KeyError): pipeline.execute() config = {'mydict': {'param1': Ref('mydict.param2')}} pipeline = Pipeline(config) with pytest.raises(KeyError): pipeline.execute() config = {'tables': {'mytable': {'mycolumn': [0, 1, 2]}}, 'myvalue': Ref('mytable.myothercolumn')} pipeline = Pipeline(config) with pytest.raises(KeyError): pipeline.execute()
def wrap_logical_op_with_cast_to_and_from(to_type): def decorator(fn): def wrap_with_cast(g, input, other): to_cast_func = globals()['_cast_{}'.format(to_type)] from_cast_func = wrap_logical_op_with_cast_to(input.type().scalarType())(fn) return from_cast_func(g, to_cast_func(g, input, False), to_cast_func(g, other, False)) return wrap_with_cast return decorator
def create_linear_automl(task: Task, n_folds: int=5, timeout: Optional[None]=None, n_reader_jobs: int=1, cpu_limit: int=4, random_state: int=42): torch.set_num_threads(cpu_limit) reader = PandasToPandasReader(task, cv=n_folds, random_state=random_state, n_jobs=n_reader_jobs) pipe = LinearFeatures() model = LinearLBFGS() pipeline = MLPipeline([model], pre_selection=None, features_pipeline=pipe, post_selection=None) automl = AutoML(reader, [[pipeline]], skip_conn=False) return automl
def register_methods(root_module): register_Ns3Address_methods(root_module, root_module['ns3::Address']) register_Ns3AllocationRetentionPriority_methods(root_module, root_module['ns3::AllocationRetentionPriority']) register_Ns3Angles_methods(root_module, root_module['ns3::Angles']) register_Ns3AttributeConstructionList_methods(root_module, root_module['ns3::AttributeConstructionList']) register_Ns3AttributeConstructionListItem_methods(root_module, root_module['ns3::AttributeConstructionList::Item']) register_Ns3BandInfo_methods(root_module, root_module['ns3::BandInfo']) register_Ns3Box_methods(root_module, root_module['ns3::Box']) register_Ns3Buffer_methods(root_module, root_module['ns3::Buffer']) register_Ns3BufferIterator_methods(root_module, root_module['ns3::Buffer::Iterator']) register_Ns3BufferSizeLevelBsr_methods(root_module, root_module['ns3::BufferSizeLevelBsr']) register_Ns3BuildBroadcastListElement_s_methods(root_module, root_module['ns3::BuildBroadcastListElement_s']) register_Ns3BuildDataListElement_s_methods(root_module, root_module['ns3::BuildDataListElement_s']) register_Ns3BuildRarListElement_s_methods(root_module, root_module['ns3::BuildRarListElement_s']) register_Ns3BwPart_s_methods(root_module, root_module['ns3::BwPart_s']) register_Ns3ByteTagIterator_methods(root_module, root_module['ns3::ByteTagIterator']) register_Ns3ByteTagIteratorItem_methods(root_module, root_module['ns3::ByteTagIterator::Item']) register_Ns3ByteTagList_methods(root_module, root_module['ns3::ByteTagList']) register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator']) register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item']) register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase']) register_Ns3ConstantVelocityHelper_methods(root_module, root_module['ns3::ConstantVelocityHelper']) register_Ns3CqiConfig_s_methods(root_module, root_module['ns3::CqiConfig_s']) register_Ns3CqiListElement_s_methods(root_module, root_module['ns3::CqiListElement_s']) register_Ns3DataOutputCallback_methods(root_module, root_module['ns3::DataOutputCallback']) register_Ns3DataRate_methods(root_module, root_module['ns3::DataRate']) register_Ns3DciInfoElement_methods(root_module, root_module['ns3::DciInfoElement']) register_Ns3DciInfoElementTdma_methods(root_module, root_module['ns3::DciInfoElementTdma']) register_Ns3DefaultDeleter__Ns3AttributeAccessor_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeAccessor >']) register_Ns3DefaultDeleter__Ns3AttributeChecker_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeChecker >']) register_Ns3DefaultDeleter__Ns3AttributeValue_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeValue >']) register_Ns3DefaultDeleter__Ns3BeamformingParams_methods(root_module, root_module['ns3::DefaultDeleter< ns3::BeamformingParams >']) register_Ns3DefaultDeleter__Ns3CallbackImplBase_methods(root_module, root_module['ns3::DefaultDeleter< ns3::CallbackImplBase >']) register_Ns3DefaultDeleter__Ns3ChannelParams_methods(root_module, root_module['ns3::DefaultDeleter< ns3::ChannelParams >']) register_Ns3DefaultDeleter__Ns3EpcTft_methods(root_module, root_module['ns3::DefaultDeleter< ns3::EpcTft >']) register_Ns3DefaultDeleter__Ns3EventImpl_methods(root_module, root_module['ns3::DefaultDeleter< ns3::EventImpl >']) register_Ns3DefaultDeleter__Ns3HashImplementation_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Hash::Implementation >']) register_Ns3DefaultDeleter__Ns3LteControlMessage_methods(root_module, root_module['ns3::DefaultDeleter< ns3::LteControlMessage >']) register_Ns3DefaultDeleter__Ns3LteHarqPhy_methods(root_module, root_module['ns3::DefaultDeleter< ns3::LteHarqPhy >']) register_Ns3DefaultDeleter__Ns3MmWaveControlMessage_methods(root_module, root_module['ns3::DefaultDeleter< ns3::MmWaveControlMessage >']) register_Ns3DefaultDeleter__Ns3MmWaveHarqPhy_methods(root_module, root_module['ns3::DefaultDeleter< ns3::MmWaveHarqPhy >']) register_Ns3DefaultDeleter__Ns3NixVector_methods(root_module, root_module['ns3::DefaultDeleter< ns3::NixVector >']) register_Ns3DefaultDeleter__Ns3Packet_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Packet >']) register_Ns3DefaultDeleter__Ns3Params3gpp_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Params3gpp >']) register_Ns3DefaultDeleter__Ns3QueueItem_methods(root_module, root_module['ns3::DefaultDeleter< ns3::QueueItem >']) register_Ns3DefaultDeleter__Ns3SpectrumModel_methods(root_module, root_module['ns3::DefaultDeleter< ns3::SpectrumModel >']) register_Ns3DefaultDeleter__Ns3SpectrumValue_methods(root_module, root_module['ns3::DefaultDeleter< ns3::SpectrumValue >']) register_Ns3DefaultDeleter__Ns3TraceParams_methods(root_module, root_module['ns3::DefaultDeleter< ns3::TraceParams >']) register_Ns3DefaultDeleter__Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::DefaultDeleter< ns3::TraceSourceAccessor >']) register_Ns3DefaultDeleter__Ns3VendorSpecificValue_methods(root_module, root_module['ns3::DefaultDeleter< ns3::VendorSpecificValue >']) register_Ns3DefaultDeleter__Ns3MmWaveChunkProcessor_methods(root_module, root_module['ns3::DefaultDeleter< ns3::MmWaveChunkProcessor >']) register_Ns3DlCqiInfo_methods(root_module, root_module['ns3::DlCqiInfo']) register_Ns3DlDciInfoElementTdma_methods(root_module, root_module['ns3::DlDciInfoElementTdma']) register_Ns3DlDciListElement_s_methods(root_module, root_module['ns3::DlDciListElement_s']) register_Ns3DlHarqInfo_methods(root_module, root_module['ns3::DlHarqInfo']) register_Ns3DlInfoListElement_s_methods(root_module, root_module['ns3::DlInfoListElement_s']) register_Ns3DlSchedulingCallbackInfo_methods(root_module, root_module['ns3::DlSchedulingCallbackInfo']) register_Ns3DrxConfig_s_methods(root_module, root_module['ns3::DrxConfig_s']) register_Ns3EnbPhyPacketCountParameter_methods(root_module, root_module['ns3::EnbPhyPacketCountParameter']) register_Ns3EpcEnbS1SapProvider_methods(root_module, root_module['ns3::EpcEnbS1SapProvider']) register_Ns3EpcEnbS1SapProviderBearerToBeSwitched_methods(root_module, root_module['ns3::EpcEnbS1SapProvider::BearerToBeSwitched']) register_Ns3EpcEnbS1SapProviderPathSwitchRequestParameters_methods(root_module, root_module['ns3::EpcEnbS1SapProvider::PathSwitchRequestParameters']) register_Ns3EpcEnbS1SapUser_methods(root_module, root_module['ns3::EpcEnbS1SapUser']) register_Ns3EpcEnbS1SapUserDataRadioBearerSetupRequestParameters_methods(root_module, root_module['ns3::EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters']) register_Ns3EpcEnbS1SapUserPathSwitchRequestAcknowledgeParameters_methods(root_module, root_module['ns3::EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters']) register_Ns3EpcX2Sap_methods(root_module, root_module['ns3::EpcX2Sap']) register_Ns3EpcX2SapCellInformationItem_methods(root_module, root_module['ns3::EpcX2Sap::CellInformationItem']) register_Ns3EpcX2SapCellMeasurementResultItem_methods(root_module, root_module['ns3::EpcX2Sap::CellMeasurementResultItem']) register_Ns3EpcX2SapCompositeAvailCapacity_methods(root_module, root_module['ns3::EpcX2Sap::CompositeAvailCapacity']) register_Ns3EpcX2SapErabAdmittedItem_methods(root_module, root_module['ns3::EpcX2Sap::ErabAdmittedItem']) register_Ns3EpcX2SapErabNotAdmittedItem_methods(root_module, root_module['ns3::EpcX2Sap::ErabNotAdmittedItem']) register_Ns3EpcX2SapErabToBeSetupItem_methods(root_module, root_module['ns3::EpcX2Sap::ErabToBeSetupItem']) register_Ns3EpcX2SapErabsSubjectToStatusTransferItem_methods(root_module, root_module['ns3::EpcX2Sap::ErabsSubjectToStatusTransferItem']) register_Ns3EpcX2SapHandoverFailedParams_methods(root_module, root_module['ns3::EpcX2Sap::HandoverFailedParams']) register_Ns3EpcX2SapHandoverPreparationFailureParams_methods(root_module, root_module['ns3::EpcX2Sap::HandoverPreparationFailureParams']) register_Ns3EpcX2SapHandoverRequestAckParams_methods(root_module, root_module['ns3::EpcX2Sap::HandoverRequestAckParams']) register_Ns3EpcX2SapHandoverRequestParams_methods(root_module, root_module['ns3::EpcX2Sap::HandoverRequestParams']) register_Ns3EpcX2SapLoadInformationParams_methods(root_module, root_module['ns3::EpcX2Sap::LoadInformationParams']) register_Ns3EpcX2SapRelativeNarrowbandTxBand_methods(root_module, root_module['ns3::EpcX2Sap::RelativeNarrowbandTxBand']) register_Ns3EpcX2SapResourceStatusUpdateParams_methods(root_module, root_module['ns3::EpcX2Sap::ResourceStatusUpdateParams']) register_Ns3EpcX2SapRlcSetupRequest_methods(root_module, root_module['ns3::EpcX2Sap::RlcSetupRequest']) register_Ns3EpcX2SapSecondaryHandoverCompletedParams_methods(root_module, root_module['ns3::EpcX2Sap::SecondaryHandoverCompletedParams']) register_Ns3EpcX2SapSecondaryHandoverParams_methods(root_module, root_module['ns3::EpcX2Sap::SecondaryHandoverParams']) register_Ns3EpcX2SapSnStatusTransferParams_methods(root_module, root_module['ns3::EpcX2Sap::SnStatusTransferParams']) register_Ns3EpcX2SapSwitchConnectionParams_methods(root_module, root_module['ns3::EpcX2Sap::SwitchConnectionParams']) register_Ns3EpcX2SapUeContextReleaseParams_methods(root_module, root_module['ns3::EpcX2Sap::UeContextReleaseParams']) register_Ns3EpcX2SapUeDataParams_methods(root_module, root_module['ns3::EpcX2Sap::UeDataParams']) register_Ns3EpcX2SapUeImsiSinrParams_methods(root_module, root_module['ns3::EpcX2Sap::UeImsiSinrParams']) register_Ns3EpcX2SapUlHighInterferenceInformationItem_methods(root_module, root_module['ns3::EpcX2Sap::UlHighInterferenceInformationItem']) register_Ns3EpcX2SapProvider_methods(root_module, root_module['ns3::EpcX2SapProvider']) register_Ns3EpcX2SapUser_methods(root_module, root_module['ns3::EpcX2SapUser']) register_Ns3EpsBearer_methods(root_module, root_module['ns3::EpsBearer']) register_Ns3EutranMeasurementMapping_methods(root_module, root_module['ns3::EutranMeasurementMapping']) register_Ns3EventId_methods(root_module, root_module['ns3::EventId']) register_Ns3ExpectedTbInfo_t_methods(root_module, root_module['ns3::ExpectedTbInfo_t']) register_Ns3FfMacCschedSapProvider_methods(root_module, root_module['ns3::FfMacCschedSapProvider']) register_Ns3FfMacCschedSapProviderCschedCellConfigReqParameters_methods(root_module, root_module['ns3::FfMacCschedSapProvider::CschedCellConfigReqParameters']) register_Ns3FfMacCschedSapProviderCschedLcConfigReqParameters_methods(root_module, root_module['ns3::FfMacCschedSapProvider::CschedLcConfigReqParameters']) register_Ns3FfMacCschedSapProviderCschedLcReleaseReqParameters_methods(root_module, root_module['ns3::FfMacCschedSapProvider::CschedLcReleaseReqParameters']) register_Ns3FfMacCschedSapProviderCschedUeConfigReqParameters_methods(root_module, root_module['ns3::FfMacCschedSapProvider::CschedUeConfigReqParameters']) register_Ns3FfMacCschedSapProviderCschedUeReleaseReqParameters_methods(root_module, root_module['ns3::FfMacCschedSapProvider::CschedUeReleaseReqParameters']) register_Ns3FfMacCschedSapUser_methods(root_module, root_module['ns3::FfMacCschedSapUser']) register_Ns3FfMacCschedSapUserCschedCellConfigCnfParameters_methods(root_module, root_module['ns3::FfMacCschedSapUser::CschedCellConfigCnfParameters']) register_Ns3FfMacCschedSapUserCschedCellConfigUpdateIndParameters_methods(root_module, root_module['ns3::FfMacCschedSapUser::CschedCellConfigUpdateIndParameters']) register_Ns3FfMacCschedSapUserCschedLcConfigCnfParameters_methods(root_module, root_module['ns3::FfMacCschedSapUser::CschedLcConfigCnfParameters']) register_Ns3FfMacCschedSapUserCschedLcReleaseCnfParameters_methods(root_module, root_module['ns3::FfMacCschedSapUser::CschedLcReleaseCnfParameters']) register_Ns3FfMacCschedSapUserCschedUeConfigCnfParameters_methods(root_module, root_module['ns3::FfMacCschedSapUser::CschedUeConfigCnfParameters']) register_Ns3FfMacCschedSapUserCschedUeConfigUpdateIndParameters_methods(root_module, root_module['ns3::FfMacCschedSapUser::CschedUeConfigUpdateIndParameters']) register_Ns3FfMacCschedSapUserCschedUeReleaseCnfParameters_methods(root_module, root_module['ns3::FfMacCschedSapUser::CschedUeReleaseCnfParameters']) register_Ns3FfMacSchedSapProvider_methods(root_module, root_module['ns3::FfMacSchedSapProvider']) register_Ns3FfMacSchedSapProviderSchedDlCqiInfoReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedDlCqiInfoReqParameters']) register_Ns3FfMacSchedSapProviderSchedDlMacBufferReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedDlMacBufferReqParameters']) register_Ns3FfMacSchedSapProviderSchedDlPagingBufferReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedDlPagingBufferReqParameters']) register_Ns3FfMacSchedSapProviderSchedDlRachInfoReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedDlRachInfoReqParameters']) register_Ns3FfMacSchedSapProviderSchedDlRlcBufferReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedDlRlcBufferReqParameters']) register_Ns3FfMacSchedSapProviderSchedDlTriggerReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedDlTriggerReqParameters']) register_Ns3FfMacSchedSapProviderSchedUlCqiInfoReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedUlCqiInfoReqParameters']) register_Ns3FfMacSchedSapProviderSchedUlMacCtrlInfoReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters']) register_Ns3FfMacSchedSapProviderSchedUlNoiseInterferenceReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters']) register_Ns3FfMacSchedSapProviderSchedUlSrInfoReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedUlSrInfoReqParameters']) register_Ns3FfMacSchedSapProviderSchedUlTriggerReqParameters_methods(root_module, root_module['ns3::FfMacSchedSapProvider::SchedUlTriggerReqParameters']) register_Ns3FfMacSchedSapUser_methods(root_module, root_module['ns3::FfMacSchedSapUser']) register_Ns3FfMacSchedSapUserSchedDlConfigIndParameters_methods(root_module, root_module['ns3::FfMacSchedSapUser::SchedDlConfigIndParameters']) register_Ns3FfMacSchedSapUserSchedUlConfigIndParameters_methods(root_module, root_module['ns3::FfMacSchedSapUser::SchedUlConfigIndParameters']) register_Ns3GbrQosInformation_methods(root_module, root_module['ns3::GbrQosInformation']) register_Ns3HarqProcessInfoElement_t_methods(root_module, root_module['ns3::HarqProcessInfoElement_t']) register_Ns3Hasher_methods(root_module, root_module['ns3::Hasher']) register_Ns3HigherLayerSelected_s_methods(root_module, root_module['ns3::HigherLayerSelected_s']) register_Ns3ImsiLcidPair_t_methods(root_module, root_module['ns3::ImsiLcidPair_t']) register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress']) register_Ns3InetSocketAddress_methods(root_module, root_module['ns3::InetSocketAddress']) register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address']) register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper']) register_Ns3Ipv4InterfaceAddress_methods(root_module, root_module['ns3::Ipv4InterfaceAddress']) register_Ns3Ipv4InterfaceContainer_methods(root_module, root_module['ns3::Ipv4InterfaceContainer']) register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask']) register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address']) register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix']) register_Ns3LogComponent_methods(root_module, root_module['ns3::LogComponent']) register_Ns3LogicalChannelConfigListElement_s_methods(root_module, root_module['ns3::LogicalChannelConfigListElement_s']) register_Ns3LteAnrSapProvider_methods(root_module, root_module['ns3::LteAnrSapProvider']) register_Ns3LteAnrSapUser_methods(root_module, root_module['ns3::LteAnrSapUser']) register_Ns3LteAsSapProvider_methods(root_module, root_module['ns3::LteAsSapProvider']) register_Ns3LteAsSapUser_methods(root_module, root_module['ns3::LteAsSapUser']) register_Ns3LteEnbCmacSapProvider_methods(root_module, root_module['ns3::LteEnbCmacSapProvider']) register_Ns3LteEnbCmacSapProviderAllocateNcRaPreambleReturnValue_methods(root_module, root_module['ns3::LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue']) register_Ns3LteEnbCmacSapProviderLcInfo_methods(root_module, root_module['ns3::LteEnbCmacSapProvider::LcInfo']) register_Ns3LteEnbCmacSapProviderRachConfig_methods(root_module, root_module['ns3::LteEnbCmacSapProvider::RachConfig']) register_Ns3LteEnbCmacSapProviderUeConfig_methods(root_module, root_module['ns3::LteEnbCmacSapProvider::UeConfig']) register_Ns3LteEnbCmacSapUser_methods(root_module, root_module['ns3::LteEnbCmacSapUser']) register_Ns3LteEnbCmacSapUserUeConfig_methods(root_module, root_module['ns3::LteEnbCmacSapUser::UeConfig']) register_Ns3LteEnbCphySapProvider_methods(root_module, root_module['ns3::LteEnbCphySapProvider']) register_Ns3LteEnbCphySapUser_methods(root_module, root_module['ns3::LteEnbCphySapUser']) register_Ns3LteEnbCphySapUserUeAssociatedSinrInfo_methods(root_module, root_module['ns3::LteEnbCphySapUser::UeAssociatedSinrInfo']) register_Ns3LteEnbPhySapProvider_methods(root_module, root_module['ns3::LteEnbPhySapProvider']) register_Ns3LteEnbPhySapUser_methods(root_module, root_module['ns3::LteEnbPhySapUser']) register_Ns3LteFfConverter_methods(root_module, root_module['ns3::LteFfConverter']) register_Ns3LteFfrRrcSapProvider_methods(root_module, root_module['ns3::LteFfrRrcSapProvider']) register_Ns3LteFfrRrcSapUser_methods(root_module, root_module['ns3::LteFfrRrcSapUser']) register_Ns3LteFlowId_t_methods(root_module, root_module['ns3::LteFlowId_t']) register_Ns3LteHandoverManagementSapProvider_methods(root_module, root_module['ns3::LteHandoverManagementSapProvider']) register_Ns3LteHandoverManagementSapUser_methods(root_module, root_module['ns3::LteHandoverManagementSapUser']) register_Ns3LteMacSapProvider_methods(root_module, root_module['ns3::LteMacSapProvider']) register_Ns3LteMacSapProviderReportBufferStatusParameters_methods(root_module, root_module['ns3::LteMacSapProvider::ReportBufferStatusParameters']) register_Ns3LteMacSapProviderTransmitPduParameters_methods(root_module, root_module['ns3::LteMacSapProvider::TransmitPduParameters']) register_Ns3LteMacSapUser_methods(root_module, root_module['ns3::LteMacSapUser']) register_Ns3LtePdcpSapProvider_methods(root_module, root_module['ns3::LtePdcpSapProvider']) register_Ns3LtePdcpSapProviderTransmitPdcpSduParameters_methods(root_module, root_module['ns3::LtePdcpSapProvider::TransmitPdcpSduParameters']) register_Ns3LtePdcpSapUser_methods(root_module, root_module['ns3::LtePdcpSapUser']) register_Ns3LtePdcpSapUserReceivePdcpSduParameters_methods(root_module, root_module['ns3::LtePdcpSapUser::ReceivePdcpSduParameters']) register_Ns3LteRlcSapProvider_methods(root_module, root_module['ns3::LteRlcSapProvider']) register_Ns3LteRlcSapProviderTransmitPdcpPduParameters_methods(root_module, root_module['ns3::LteRlcSapProvider::TransmitPdcpPduParameters']) register_Ns3LteRlcSapUser_methods(root_module, root_module['ns3::LteRlcSapUser']) register_Ns3LteRlcSpecificLteMacSapUser_methods(root_module, root_module['ns3::LteRlcSpecificLteMacSapUser']) register_Ns3LteRrcSap_methods(root_module, root_module['ns3::LteRrcSap']) register_Ns3LteRrcSapAntennaInfoDedicated_methods(root_module, root_module['ns3::LteRrcSap::AntennaInfoDedicated']) register_Ns3LteRrcSapAsConfig_methods(root_module, root_module['ns3::LteRrcSap::AsConfig']) register_Ns3LteRrcSapBlackCellsToAddMod_methods(root_module, root_module['ns3::LteRrcSap::BlackCellsToAddMod']) register_Ns3LteRrcSapCarrierBandwidthEutra_methods(root_module, root_module['ns3::LteRrcSap::CarrierBandwidthEutra']) register_Ns3LteRrcSapCarrierFreqEutra_methods(root_module, root_module['ns3::LteRrcSap::CarrierFreqEutra']) register_Ns3LteRrcSapCellAccessRelatedInfo_methods(root_module, root_module['ns3::LteRrcSap::CellAccessRelatedInfo']) register_Ns3LteRrcSapCellSelectionInfo_methods(root_module, root_module['ns3::LteRrcSap::CellSelectionInfo']) register_Ns3LteRrcSapCellsToAddMod_methods(root_module, root_module['ns3::LteRrcSap::CellsToAddMod']) register_Ns3LteRrcSapCgiInfo_methods(root_module, root_module['ns3::LteRrcSap::CgiInfo']) register_Ns3LteRrcSapDrbToAddMod_methods(root_module, root_module['ns3::LteRrcSap::DrbToAddMod']) register_Ns3LteRrcSapFreqInfo_methods(root_module, root_module['ns3::LteRrcSap::FreqInfo']) register_Ns3LteRrcSapHandoverPreparationInfo_methods(root_module, root_module['ns3::LteRrcSap::HandoverPreparationInfo']) register_Ns3LteRrcSapLogicalChannelConfig_methods(root_module, root_module['ns3::LteRrcSap::LogicalChannelConfig']) register_Ns3LteRrcSapMasterInformationBlock_methods(root_module, root_module['ns3::LteRrcSap::MasterInformationBlock']) register_Ns3LteRrcSapMeasConfig_methods(root_module, root_module['ns3::LteRrcSap::MeasConfig']) register_Ns3LteRrcSapMeasGapConfig_methods(root_module, root_module['ns3::LteRrcSap::MeasGapConfig']) register_Ns3LteRrcSapMeasIdToAddMod_methods(root_module, root_module['ns3::LteRrcSap::MeasIdToAddMod']) register_Ns3LteRrcSapMeasObjectEutra_methods(root_module, root_module['ns3::LteRrcSap::MeasObjectEutra']) register_Ns3LteRrcSapMeasObjectToAddMod_methods(root_module, root_module['ns3::LteRrcSap::MeasObjectToAddMod']) register_Ns3LteRrcSapMeasResultEutra_methods(root_module, root_module['ns3::LteRrcSap::MeasResultEutra']) register_Ns3LteRrcSapMeasResults_methods(root_module, root_module['ns3::LteRrcSap::MeasResults']) register_Ns3LteRrcSapMeasurementReport_methods(root_module, root_module['ns3::LteRrcSap::MeasurementReport']) register_Ns3LteRrcSapMobilityControlInfo_methods(root_module, root_module['ns3::LteRrcSap::MobilityControlInfo']) register_Ns3LteRrcSapMobilityStateParameters_methods(root_module, root_module['ns3::LteRrcSap::MobilityStateParameters']) register_Ns3LteRrcSapPdschConfigCommon_methods(root_module, root_module['ns3::LteRrcSap::PdschConfigCommon']) register_Ns3LteRrcSapPdschConfigDedicated_methods(root_module, root_module['ns3::LteRrcSap::PdschConfigDedicated']) register_Ns3LteRrcSapPhysCellIdRange_methods(root_module, root_module['ns3::LteRrcSap::PhysCellIdRange']) register_Ns3LteRrcSapPhysicalConfigDedicated_methods(root_module, root_module['ns3::LteRrcSap::PhysicalConfigDedicated']) register_Ns3LteRrcSapPlmnIdentityInfo_methods(root_module, root_module['ns3::LteRrcSap::PlmnIdentityInfo']) register_Ns3LteRrcSapPreambleInfo_methods(root_module, root_module['ns3::LteRrcSap::PreambleInfo']) register_Ns3LteRrcSapQuantityConfig_methods(root_module, root_module['ns3::LteRrcSap::QuantityConfig']) register_Ns3LteRrcSapRaSupervisionInfo_methods(root_module, root_module['ns3::LteRrcSap::RaSupervisionInfo']) register_Ns3LteRrcSapRachConfigCommon_methods(root_module, root_module['ns3::LteRrcSap::RachConfigCommon']) register_Ns3LteRrcSapRachConfigDedicated_methods(root_module, root_module['ns3::LteRrcSap::RachConfigDedicated']) register_Ns3LteRrcSapRadioResourceConfigCommon_methods(root_module, root_module['ns3::LteRrcSap::RadioResourceConfigCommon']) register_Ns3LteRrcSapRadioResourceConfigCommonSib_methods(root_module, root_module['ns3::LteRrcSap::RadioResourceConfigCommonSib']) register_Ns3LteRrcSapRadioResourceConfigDedicated_methods(root_module, root_module['ns3::LteRrcSap::RadioResourceConfigDedicated']) register_Ns3LteRrcSapReestabUeIdentity_methods(root_module, root_module['ns3::LteRrcSap::ReestabUeIdentity']) register_Ns3LteRrcSapReportConfigEutra_methods(root_module, root_module['ns3::LteRrcSap::ReportConfigEutra']) register_Ns3LteRrcSapReportConfigToAddMod_methods(root_module, root_module['ns3::LteRrcSap::ReportConfigToAddMod']) register_Ns3LteRrcSapRlcConfig_methods(root_module, root_module['ns3::LteRrcSap::RlcConfig']) register_Ns3LteRrcSapRrcConnectionReconfiguration_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionReconfiguration']) register_Ns3LteRrcSapRrcConnectionReconfigurationCompleted_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionReconfigurationCompleted']) register_Ns3LteRrcSapRrcConnectionReestablishment_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionReestablishment']) register_Ns3LteRrcSapRrcConnectionReestablishmentComplete_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionReestablishmentComplete']) register_Ns3LteRrcSapRrcConnectionReestablishmentReject_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionReestablishmentReject']) register_Ns3LteRrcSapRrcConnectionReestablishmentRequest_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionReestablishmentRequest']) register_Ns3LteRrcSapRrcConnectionReject_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionReject']) register_Ns3LteRrcSapRrcConnectionRelease_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionRelease']) register_Ns3LteRrcSapRrcConnectionRequest_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionRequest']) register_Ns3LteRrcSapRrcConnectionSetup_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionSetup']) register_Ns3LteRrcSapRrcConnectionSetupCompleted_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionSetupCompleted']) register_Ns3LteRrcSapRrcConnectionSwitch_methods(root_module, root_module['ns3::LteRrcSap::RrcConnectionSwitch']) register_Ns3LteRrcSapSoundingRsUlConfigCommon_methods(root_module, root_module['ns3::LteRrcSap::SoundingRsUlConfigCommon']) register_Ns3LteRrcSapSoundingRsUlConfigDedicated_methods(root_module, root_module['ns3::LteRrcSap::SoundingRsUlConfigDedicated']) register_Ns3LteRrcSapSpeedStatePars_methods(root_module, root_module['ns3::LteRrcSap::SpeedStatePars']) register_Ns3LteRrcSapSpeedStateScaleFactors_methods(root_module, root_module['ns3::LteRrcSap::SpeedStateScaleFactors']) register_Ns3LteRrcSapSrbToAddMod_methods(root_module, root_module['ns3::LteRrcSap::SrbToAddMod']) register_Ns3LteRrcSapSystemInformation_methods(root_module, root_module['ns3::LteRrcSap::SystemInformation']) register_Ns3LteRrcSapSystemInformationBlockType1_methods(root_module, root_module['ns3::LteRrcSap::SystemInformationBlockType1']) register_Ns3LteRrcSapSystemInformationBlockType2_methods(root_module, root_module['ns3::LteRrcSap::SystemInformationBlockType2']) register_Ns3LteRrcSapThresholdEutra_methods(root_module, root_module['ns3::LteRrcSap::ThresholdEutra']) register_Ns3LteSpectrumValueHelper_methods(root_module, root_module['ns3::LteSpectrumValueHelper']) register_Ns3LteUeCmacSapProvider_methods(root_module, root_module['ns3::LteUeCmacSapProvider']) register_Ns3LteUeCmacSapProviderLogicalChannelConfig_methods(root_module, root_module['ns3::LteUeCmacSapProvider::LogicalChannelConfig']) register_Ns3LteUeCmacSapProviderRachConfig_methods(root_module, root_module['ns3::LteUeCmacSapProvider::RachConfig']) register_Ns3LteUeCmacSapUser_methods(root_module, root_module['ns3::LteUeCmacSapUser']) register_Ns3LteUeConfig_t_methods(root_module, root_module['ns3::LteUeConfig_t']) register_Ns3LteUeCphySapProvider_methods(root_module, root_module['ns3::LteUeCphySapProvider']) register_Ns3LteUeCphySapUser_methods(root_module, root_module['ns3::LteUeCphySapUser']) register_Ns3LteUeCphySapUserUeMeasurementsElement_methods(root_module, root_module['ns3::LteUeCphySapUser::UeMeasurementsElement']) register_Ns3LteUeCphySapUserUeMeasurementsParameters_methods(root_module, root_module['ns3::LteUeCphySapUser::UeMeasurementsParameters']) register_Ns3LteUePhySapProvider_methods(root_module, root_module['ns3::LteUePhySapProvider']) register_Ns3LteUePhySapUser_methods(root_module, root_module['ns3::LteUePhySapUser']) register_Ns3LteUeRrcSapProvider_methods(root_module, root_module['ns3::LteUeRrcSapProvider']) register_Ns3LteUeRrcSapProviderCompleteSetupParameters_methods(root_module, root_module['ns3::LteUeRrcSapProvider::CompleteSetupParameters']) register_Ns3LteUeRrcSapUser_methods(root_module, root_module['ns3::LteUeRrcSapUser']) register_Ns3LteUeRrcSapUserSetupParameters_methods(root_module, root_module['ns3::LteUeRrcSapUser::SetupParameters']) register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address']) register_Ns3MacCeElement_methods(root_module, root_module['ns3::MacCeElement']) register_Ns3MacCeListElement_s_methods(root_module, root_module['ns3::MacCeListElement_s']) register_Ns3MacCeValue_methods(root_module, root_module['ns3::MacCeValue']) register_Ns3MacCeValue_u_methods(root_module, root_module['ns3::MacCeValue_u']) register_Ns3MacPduInfo_methods(root_module, root_module['ns3::MacPduInfo']) register_Ns3MacSubheader_methods(root_module, root_module['ns3::MacSubheader']) register_Ns3MmWaveDlHarqProcessInfo_methods(root_module, root_module['ns3::MmWaveDlHarqProcessInfo']) register_Ns3MmWaveEnbPhySapUser_methods(root_module, root_module['ns3::MmWaveEnbPhySapUser']) register_Ns3MmWaveHarqProcessInfoElement_t_methods(root_module, root_module['ns3::MmWaveHarqProcessInfoElement_t']) register_Ns3MmWaveMacCschedSapProvider_methods(root_module, root_module['ns3::MmWaveMacCschedSapProvider']) register_Ns3MmWaveMacCschedSapProviderCschedCellConfigReqParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapProvider::CschedCellConfigReqParameters']) register_Ns3MmWaveMacCschedSapProviderCschedLcConfigReqParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapProvider::CschedLcConfigReqParameters']) register_Ns3MmWaveMacCschedSapProviderCschedLcReleaseReqParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapProvider::CschedLcReleaseReqParameters']) register_Ns3MmWaveMacCschedSapProviderCschedUeConfigReqParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapProvider::CschedUeConfigReqParameters']) register_Ns3MmWaveMacCschedSapProviderCschedUeReleaseReqParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapProvider::CschedUeReleaseReqParameters']) register_Ns3MmWaveMacCschedSapUser_methods(root_module, root_module['ns3::MmWaveMacCschedSapUser']) register_Ns3MmWaveMacCschedSapUserCschedCellConfigCnfParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapUser::CschedCellConfigCnfParameters']) register_Ns3MmWaveMacCschedSapUserCschedCellConfigUpdateIndParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapUser::CschedCellConfigUpdateIndParameters']) register_Ns3MmWaveMacCschedSapUserCschedLcConfigCnfParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapUser::CschedLcConfigCnfParameters']) register_Ns3MmWaveMacCschedSapUserCschedLcReleaseCnfParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapUser::CschedLcReleaseCnfParameters']) register_Ns3MmWaveMacCschedSapUserCschedUeConfigCnfParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapUser::CschedUeConfigCnfParameters']) register_Ns3MmWaveMacCschedSapUserCschedUeConfigUpdateIndParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapUser::CschedUeConfigUpdateIndParameters']) register_Ns3MmWaveMacCschedSapUserCschedUeReleaseCnfParameters_methods(root_module, root_module['ns3::MmWaveMacCschedSapUser::CschedUeReleaseCnfParameters']) register_Ns3MmWaveMacSchedSapProvider_methods(root_module, root_module['ns3::MmWaveMacSchedSapProvider']) register_Ns3MmWaveMacSchedSapProviderSchedDlCqiInfoReqParameters_methods(root_module, root_module['ns3::MmWaveMacSchedSapProvider::SchedDlCqiInfoReqParameters']) register_Ns3MmWaveMacSchedSapProviderSchedDlRlcBufferReqParameters_methods(root_module, root_module['ns3::MmWaveMacSchedSapProvider::SchedDlRlcBufferReqParameters']) register_Ns3MmWaveMacSchedSapProviderSchedTriggerReqParameters_methods(root_module, root_module['ns3::MmWaveMacSchedSapProvider::SchedTriggerReqParameters']) register_Ns3MmWaveMacSchedSapProviderSchedUlCqiInfoReqParameters_methods(root_module, root_module['ns3::MmWaveMacSchedSapProvider::SchedUlCqiInfoReqParameters']) register_Ns3MmWaveMacSchedSapProviderSchedUlMacCtrlInfoReqParameters_methods(root_module, root_module['ns3::MmWaveMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters']) register_Ns3MmWaveMacSchedSapUser_methods(root_module, root_module['ns3::MmWaveMacSchedSapUser']) register_Ns3MmWaveMacSchedSapUserSchedConfigIndParameters_methods(root_module, root_module['ns3::MmWaveMacSchedSapUser::SchedConfigIndParameters']) register_Ns3MmWaveMiErrorModel_methods(root_module, root_module['ns3::MmWaveMiErrorModel']) register_Ns3MmWavePhySapProvider_methods(root_module, root_module['ns3::MmWavePhySapProvider']) register_Ns3MmWaveRealProtocolRlcSapUser_methods(root_module, root_module['ns3::MmWaveRealProtocolRlcSapUser']) register_Ns3MmWaveSpectrumValueHelper_methods(root_module, root_module['ns3::MmWaveSpectrumValueHelper']) register_Ns3MmWaveTbStats_t_methods(root_module, root_module['ns3::MmWaveTbStats_t']) register_Ns3MmWaveUePhySapUser_methods(root_module, root_module['ns3::MmWaveUePhySapUser']) register_Ns3Names_methods(root_module, root_module['ns3::Names']) register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer']) register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer']) register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase']) register_Ns3ObjectDeleter_methods(root_module, root_module['ns3::ObjectDeleter']) register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory']) register_Ns3PacketMetadata_methods(root_module, root_module['ns3::PacketMetadata']) register_Ns3PacketMetadataItem_methods(root_module, root_module['ns3::PacketMetadata::Item']) register_Ns3PacketMetadataItemIterator_methods(root_module, root_module['ns3::PacketMetadata::ItemIterator']) register_Ns3PacketTagIterator_methods(root_module, root_module['ns3::PacketTagIterator']) register_Ns3PacketTagIteratorItem_methods(root_module, root_module['ns3::PacketTagIterator::Item']) register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList']) register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData']) register_Ns3PagingInfoListElement_s_methods(root_module, root_module['ns3::PagingInfoListElement_s']) register_Ns3ParameterLogger_methods(root_module, root_module['ns3::ParameterLogger']) register_Ns3PhichListElement_s_methods(root_module, root_module['ns3::PhichListElement_s']) register_Ns3PhyReceptionStatParameters_methods(root_module, root_module['ns3::PhyReceptionStatParameters']) register_Ns3PhyTransmissionStatParameters_methods(root_module, root_module['ns3::PhyTransmissionStatParameters']) register_Ns3RachListElement_s_methods(root_module, root_module['ns3::RachListElement_s']) register_Ns3RlcListElement_methods(root_module, root_module['ns3::RlcListElement']) register_Ns3RlcPduInfo_methods(root_module, root_module['ns3::RlcPduInfo']) register_Ns3RlcPduListElement_s_methods(root_module, root_module['ns3::RlcPduListElement_s']) register_Ns3RxPacketTraceParams_methods(root_module, root_module['ns3::RxPacketTraceParams']) register_Ns3SbMeasResult_s_methods(root_module, root_module['ns3::SbMeasResult_s']) register_Ns3SchedInfo_methods(root_module, root_module['ns3::SchedInfo']) register_Ns3SequenceNumber10_methods(root_module, root_module['ns3::SequenceNumber10']) register_Ns3SfAllocInfo_methods(root_module, root_module['ns3::SfAllocInfo']) register_Ns3SfnSf_methods(root_module, root_module['ns3::SfnSf']) register_Ns3SiConfiguration_s_methods(root_module, root_module['ns3::SiConfiguration_s']) register_Ns3SiMessageListElement_s_methods(root_module, root_module['ns3::SiMessageListElement_s']) register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator']) register_Ns3SlotAllocInfo_methods(root_module, root_module['ns3::SlotAllocInfo']) register_Ns3SpsConfig_s_methods(root_module, root_module['ns3::SpsConfig_s']) register_Ns3SrConfig_s_methods(root_module, root_module['ns3::SrConfig_s']) register_Ns3SrListElement_s_methods(root_module, root_module['ns3::SrListElement_s']) register_Ns3StatisticalSummary_methods(root_module, root_module['ns3::StatisticalSummary']) register_Ns3Tag_methods(root_module, root_module['ns3::Tag']) register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer']) register_Ns3TbAllocInfo_methods(root_module, root_module['ns3::TbAllocInfo']) register_Ns3TbId_t_methods(root_module, root_module['ns3::TbId_t']) register_Ns3TbInfoElement_methods(root_module, root_module['ns3::TbInfoElement']) register_Ns3TimeWithUnit_methods(root_module, root_module['ns3::TimeWithUnit']) register_Ns3TracedValue__Bool_methods(root_module, root_module['ns3::TracedValue< bool >']) register_Ns3TracedValue__Unsigned_int_methods(root_module, root_module['ns3::TracedValue< unsigned int >']) register_Ns3TransmissionModesLayers_methods(root_module, root_module['ns3::TransmissionModesLayers']) register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId']) register_Ns3TypeIdAttributeInformation_methods(root_module, root_module['ns3::TypeId::AttributeInformation']) register_Ns3TypeIdTraceSourceInformation_methods(root_module, root_module['ns3::TypeId::TraceSourceInformation']) register_Ns3UeCapabilities_s_methods(root_module, root_module['ns3::UeCapabilities_s']) register_Ns3UePhyPacketCountParameter_methods(root_module, root_module['ns3::UePhyPacketCountParameter']) register_Ns3UeSelected_s_methods(root_module, root_module['ns3::UeSelected_s']) register_Ns3UlCqiInfo_methods(root_module, root_module['ns3::UlCqiInfo']) register_Ns3UlCqi_s_methods(root_module, root_module['ns3::UlCqi_s']) register_Ns3UlDciListElement_s_methods(root_module, root_module['ns3::UlDciListElement_s']) register_Ns3UlGrant_s_methods(root_module, root_module['ns3::UlGrant_s']) register_Ns3UlHarqInfo_methods(root_module, root_module['ns3::UlHarqInfo']) register_Ns3UlInfoListElement_s_methods(root_module, root_module['ns3::UlInfoListElement_s']) register_Ns3Vector2D_methods(root_module, root_module['ns3::Vector2D']) register_Ns3Vector3D_methods(root_module, root_module['ns3::Vector3D']) register_Ns3VendorSpecificListElement_s_methods(root_module, root_module['ns3::VendorSpecificListElement_s']) register_Ns3Empty_methods(root_module, root_module['ns3::empty']) register_Ns3Int64x64_t_methods(root_module, root_module['ns3::int64x64_t']) register_Ns3TbInfo_t_methods(root_module, root_module['ns3::tbInfo_t']) register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk']) register_Ns3EpcX2PdcpProvider_methods(root_module, root_module['ns3::EpcX2PdcpProvider']) register_Ns3EpcX2PdcpUser_methods(root_module, root_module['ns3::EpcX2PdcpUser']) register_Ns3EpcX2RlcProvider_methods(root_module, root_module['ns3::EpcX2RlcProvider']) register_Ns3EpcX2RlcUser_methods(root_module, root_module['ns3::EpcX2RlcUser']) register_Ns3Header_methods(root_module, root_module['ns3::Header']) register_Ns3LteEnbRrcSapProvider_methods(root_module, root_module['ns3::LteEnbRrcSapProvider']) register_Ns3LteEnbRrcSapProviderCompleteSetupUeParameters_methods(root_module, root_module['ns3::LteEnbRrcSapProvider::CompleteSetupUeParameters']) register_Ns3LteEnbRrcSapUser_methods(root_module, root_module['ns3::LteEnbRrcSapUser']) register_Ns3LteEnbRrcSapUserSetupUeParameters_methods(root_module, root_module['ns3::LteEnbRrcSapUser::SetupUeParameters']) register_Ns3LtePdcpHeader_methods(root_module, root_module['ns3::LtePdcpHeader']) register_Ns3LteRadioBearerTag_methods(root_module, root_module['ns3::LteRadioBearerTag']) register_Ns3MmWaveMacPduHeader_methods(root_module, root_module['ns3::MmWaveMacPduHeader']) register_Ns3MmWaveMacPduTag_methods(root_module, root_module['ns3::MmWaveMacPduTag']) register_Ns3MmWaveRadioBearerTag_methods(root_module, root_module['ns3::MmWaveRadioBearerTag']) register_Ns3Object_methods(root_module, root_module['ns3::Object']) register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator']) register_Ns3PacketBurst_methods(root_module, root_module['ns3::PacketBurst']) register_Ns3PacketFilter_methods(root_module, root_module['ns3::PacketFilter']) register_Ns3ParamsTable_methods(root_module, root_module['ns3::ParamsTable']) register_Ns3PropagationLossModel_methods(root_module, root_module['ns3::PropagationLossModel']) register_Ns3QueueDisc_methods(root_module, root_module['ns3::QueueDisc']) register_Ns3QueueDiscStats_methods(root_module, root_module['ns3::QueueDisc::Stats']) register_Ns3QueueDiscClass_methods(root_module, root_module['ns3::QueueDiscClass']) register_Ns3RandomPropagationLossModel_methods(root_module, root_module['ns3::RandomPropagationLossModel']) register_Ns3RandomVariableStream_methods(root_module, root_module['ns3::RandomVariableStream']) register_Ns3RangePropagationLossModel_methods(root_module, root_module['ns3::RangePropagationLossModel']) register_Ns3RlcBearerInfo_methods(root_module, root_module['ns3::RlcBearerInfo']) register_Ns3SequentialRandomVariable_methods(root_module, root_module['ns3::SequentialRandomVariable']) register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >']) register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >']) register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >']) register_Ns3SimpleRefCount__Ns3BeamformingParams_Ns3Empty_Ns3DefaultDeleter__lt__ns3BeamformingParams__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::BeamformingParams, ns3::empty, ns3::DefaultDeleter<ns3::BeamformingParams> >']) register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >']) register_Ns3SimpleRefCount__Ns3ChannelParams_Ns3Empty_Ns3DefaultDeleter__lt__ns3ChannelParams__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::ChannelParams, ns3::empty, ns3::DefaultDeleter<ns3::ChannelParams> >']) register_Ns3SimpleRefCount__Ns3EpcTft_Ns3Empty_Ns3DefaultDeleter__lt__ns3EpcTft__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::EpcTft, ns3::empty, ns3::DefaultDeleter<ns3::EpcTft> >']) register_Ns3SimpleRefCount__Ns3EpcTftClassifier_Ns3Empty_Ns3DefaultDeleter__lt__ns3EpcTftClassifier__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::EpcTftClassifier, ns3::empty, ns3::DefaultDeleter<ns3::EpcTftClassifier> >']) register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >']) register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >']) register_Ns3SimpleRefCount__Ns3Ipv4MulticastRoute_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4MulticastRoute__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >']) register_Ns3SimpleRefCount__Ns3Ipv4Route_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4Route__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >']) register_Ns3SimpleRefCount__Ns3LteControlMessage_Ns3Empty_Ns3DefaultDeleter__lt__ns3LteControlMessage__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::LteControlMessage, ns3::empty, ns3::DefaultDeleter<ns3::LteControlMessage> >']) register_Ns3SimpleRefCount__Ns3LteHarqPhy_Ns3Empty_Ns3DefaultDeleter__lt__ns3LteHarqPhy__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::LteHarqPhy, ns3::empty, ns3::DefaultDeleter<ns3::LteHarqPhy> >']) register_Ns3SimpleRefCount__Ns3MmWaveControlMessage_Ns3Empty_Ns3DefaultDeleter__lt__ns3MmWaveControlMessage__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::MmWaveControlMessage, ns3::empty, ns3::DefaultDeleter<ns3::MmWaveControlMessage> >']) register_Ns3SimpleRefCount__Ns3MmWaveHarqPhy_Ns3Empty_Ns3DefaultDeleter__lt__ns3MmWaveHarqPhy__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::MmWaveHarqPhy, ns3::empty, ns3::DefaultDeleter<ns3::MmWaveHarqPhy> >']) register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >']) register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >']) register_Ns3SimpleRefCount__Ns3Params3gpp_Ns3Empty_Ns3DefaultDeleter__lt__ns3Params3gpp__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Params3gpp, ns3::empty, ns3::DefaultDeleter<ns3::Params3gpp> >']) register_Ns3SimpleRefCount__Ns3QueueItem_Ns3Empty_Ns3DefaultDeleter__lt__ns3QueueItem__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::QueueItem, ns3::empty, ns3::DefaultDeleter<ns3::QueueItem> >']) register_Ns3SimpleRefCount__Ns3SpectrumModel_Ns3Empty_Ns3DefaultDeleter__lt__ns3SpectrumModel__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::SpectrumModel, ns3::empty, ns3::DefaultDeleter<ns3::SpectrumModel> >']) register_Ns3SimpleRefCount__Ns3SpectrumSignalParameters_Ns3Empty_Ns3DefaultDeleter__lt__ns3SpectrumSignalParameters__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::SpectrumSignalParameters, ns3::empty, ns3::DefaultDeleter<ns3::SpectrumSignalParameters> >']) register_Ns3SimpleRefCount__Ns3SpectrumValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3SpectrumValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::SpectrumValue, ns3::empty, ns3::DefaultDeleter<ns3::SpectrumValue> >']) register_Ns3SimpleRefCount__Ns3TraceParams_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceParams__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceParams, ns3::empty, ns3::DefaultDeleter<ns3::TraceParams> >']) register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >']) register_Ns3SimpleRefCount__Ns3VendorSpecificValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3VendorSpecificValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::VendorSpecificValue, ns3::empty, ns3::DefaultDeleter<ns3::VendorSpecificValue> >']) register_Ns3SimpleRefCount__Ns3ChannelMatrix_Ns3Empty_Ns3DefaultDeleter__lt__ns3ChannelMatrix__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::channelMatrix, ns3::empty, ns3::DefaultDeleter<ns3::channelMatrix> >']) register_Ns3SimpleRefCount__Ns3MmWaveBeamFormingParams_Ns3Empty_Ns3DefaultDeleter__lt__ns3MmWaveBeamFormingParams__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::mmWaveBeamFormingParams, ns3::empty, ns3::DefaultDeleter<ns3::mmWaveBeamFormingParams> >']) register_Ns3SimpleRefCount__Ns3MmWaveBeamFormingTraces_Ns3Empty_Ns3DefaultDeleter__lt__ns3MmWaveBeamFormingTraces__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::mmWaveBeamFormingTraces, ns3::empty, ns3::DefaultDeleter<ns3::mmWaveBeamFormingTraces> >']) register_Ns3SimpleRefCount__Ns3MmWaveChunkProcessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3MmWaveChunkProcessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::MmWaveChunkProcessor, ns3::empty, ns3::DefaultDeleter<ns3::MmWaveChunkProcessor> >']) register_Ns3Socket_methods(root_module, root_module['ns3::Socket']) register_Ns3SocketIpTosTag_methods(root_module, root_module['ns3::SocketIpTosTag']) register_Ns3SocketIpTtlTag_methods(root_module, root_module['ns3::SocketIpTtlTag']) register_Ns3SocketIpv6HopLimitTag_methods(root_module, root_module['ns3::SocketIpv6HopLimitTag']) register_Ns3SocketIpv6TclassTag_methods(root_module, root_module['ns3::SocketIpv6TclassTag']) register_Ns3SocketPriorityTag_methods(root_module, root_module['ns3::SocketPriorityTag']) register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag']) register_Ns3SpectrumInterference_methods(root_module, root_module['ns3::SpectrumInterference']) register_Ns3SpectrumModel_methods(root_module, root_module['ns3::SpectrumModel']) register_Ns3SpectrumPhy_methods(root_module, root_module['ns3::SpectrumPhy']) register_Ns3SpectrumPropagationLossModel_methods(root_module, root_module['ns3::SpectrumPropagationLossModel']) register_Ns3SpectrumSignalParameters_methods(root_module, root_module['ns3::SpectrumSignalParameters']) register_Ns3SpectrumValue_methods(root_module, root_module['ns3::SpectrumValue']) register_Ns3ThreeLogDistancePropagationLossModel_methods(root_module, root_module['ns3::ThreeLogDistancePropagationLossModel']) register_Ns3Time_methods(root_module, root_module['ns3::Time']) register_Ns3TraceParams_methods(root_module, root_module['ns3::TraceParams']) register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor']) register_Ns3TracedValue__Ns3Time_methods(root_module, root_module['ns3::TracedValue< ns3::Time >']) register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer']) register_Ns3TriangularRandomVariable_methods(root_module, root_module['ns3::TriangularRandomVariable']) register_Ns3TwoRayGroundPropagationLossModel_methods(root_module, root_module['ns3::TwoRayGroundPropagationLossModel']) register_Ns3UeManager_methods(root_module, root_module['ns3::UeManager']) register_Ns3UniformRandomVariable_methods(root_module, root_module['ns3::UniformRandomVariable']) register_Ns3VendorSpecificValue_methods(root_module, root_module['ns3::VendorSpecificValue']) register_Ns3WeibullRandomVariable_methods(root_module, root_module['ns3::WeibullRandomVariable']) register_Ns3ZetaRandomVariable_methods(root_module, root_module['ns3::ZetaRandomVariable']) register_Ns3ZipfRandomVariable_methods(root_module, root_module['ns3::ZipfRandomVariable']) register_Ns3ChannelMatrix_methods(root_module, root_module['ns3::channelMatrix']) register_Ns3MmWaveBeamFormingParams_methods(root_module, root_module['ns3::mmWaveBeamFormingParams']) register_Ns3MmWaveBeamFormingTraces_methods(root_module, root_module['ns3::mmWaveBeamFormingTraces']) register_Ns3MmWaveChunkProcessor_methods(root_module, root_module['ns3::MmWaveChunkProcessor']) register_Ns3MmWaveInterference_methods(root_module, root_module['ns3::mmWaveInterference']) register_Ns3MmwaveSpectrumSignalParameters_methods(root_module, root_module['ns3::mmwaveSpectrumSignalParameters']) register_Ns3AntennaModel_methods(root_module, root_module['ns3::AntennaModel']) register_Ns3Asn1Header_methods(root_module, root_module['ns3::Asn1Header']) register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor']) register_Ns3AttributeChecker_methods(root_module, root_module['ns3::AttributeChecker']) register_Ns3AttributeValue_methods(root_module, root_module['ns3::AttributeValue']) register_Ns3BeamformingParams_methods(root_module, root_module['ns3::BeamformingParams']) register_Ns3BooleanChecker_methods(root_module, root_module['ns3::BooleanChecker']) register_Ns3BooleanValue_methods(root_module, root_module['ns3::BooleanValue']) register_Ns3BoxChecker_methods(root_module, root_module['ns3::BoxChecker']) register_Ns3BoxValue_methods(root_module, root_module['ns3::BoxValue']) register_Ns3Building_methods(root_module, root_module['ns3::Building']) register_Ns3BuildingsPropagationLossModel_methods(root_module, root_module['ns3::BuildingsPropagationLossModel']) register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker']) register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase']) register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue']) register_Ns3Channel_methods(root_module, root_module['ns3::Channel']) register_Ns3ChannelParams_methods(root_module, root_module['ns3::ChannelParams']) register_Ns3CoDelQueueDisc_methods(root_module, root_module['ns3::CoDelQueueDisc']) register_Ns3ConstantRandomVariable_methods(root_module, root_module['ns3::ConstantRandomVariable']) register_Ns3CoreNetworkStatsCalculator_methods(root_module, root_module['ns3::CoreNetworkStatsCalculator']) register_Ns3DataCalculator_methods(root_module, root_module['ns3::DataCalculator']) register_Ns3DataOutputInterface_methods(root_module, root_module['ns3::DataOutputInterface']) register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker']) register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue']) register_Ns3DeterministicRandomVariable_methods(root_module, root_module['ns3::DeterministicRandomVariable']) register_Ns3DoubleValue_methods(root_module, root_module['ns3::DoubleValue']) register_Ns3EmpiricalRandomVariable_methods(root_module, root_module['ns3::EmpiricalRandomVariable']) register_Ns3EmptyAttributeAccessor_methods(root_module, root_module['ns3::EmptyAttributeAccessor']) register_Ns3EmptyAttributeChecker_methods(root_module, root_module['ns3::EmptyAttributeChecker']) register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue']) register_Ns3EnumChecker_methods(root_module, root_module['ns3::EnumChecker']) register_Ns3EnumValue_methods(root_module, root_module['ns3::EnumValue']) register_Ns3EpcHelper_methods(root_module, root_module['ns3::EpcHelper']) register_Ns3EpcTft_methods(root_module, root_module['ns3::EpcTft']) register_Ns3EpcTftPacketFilter_methods(root_module, root_module['ns3::EpcTft::PacketFilter']) register_Ns3EpcTftClassifier_methods(root_module, root_module['ns3::EpcTftClassifier']) register_Ns3EpcUeNas_methods(root_module, root_module['ns3::EpcUeNas']) register_Ns3ErlangRandomVariable_methods(root_module, root_module['ns3::ErlangRandomVariable']) register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl']) register_Ns3ExponentialRandomVariable_methods(root_module, root_module['ns3::ExponentialRandomVariable']) register_Ns3FfMacScheduler_methods(root_module, root_module['ns3::FfMacScheduler']) register_Ns3FixedRssLossModel_methods(root_module, root_module['ns3::FixedRssLossModel']) register_Ns3FriisPropagationLossModel_methods(root_module, root_module['ns3::FriisPropagationLossModel']) register_Ns3GammaRandomVariable_methods(root_module, root_module['ns3::GammaRandomVariable']) register_Ns3IntegerValue_methods(root_module, root_module['ns3::IntegerValue']) register_Ns3Ipv4_methods(root_module, root_module['ns3::Ipv4']) register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker']) register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue']) register_Ns3Ipv4MaskChecker_methods(root_module, root_module['ns3::Ipv4MaskChecker']) register_Ns3Ipv4MaskValue_methods(root_module, root_module['ns3::Ipv4MaskValue']) register_Ns3Ipv4MulticastRoute_methods(root_module, root_module['ns3::Ipv4MulticastRoute']) register_Ns3Ipv4Route_methods(root_module, root_module['ns3::Ipv4Route']) register_Ns3Ipv6AddressChecker_methods(root_module, root_module['ns3::Ipv6AddressChecker']) register_Ns3Ipv6AddressValue_methods(root_module, root_module['ns3::Ipv6AddressValue']) register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker']) register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue']) register_Ns3LogDistancePropagationLossModel_methods(root_module, root_module['ns3::LogDistancePropagationLossModel']) register_Ns3LogNormalRandomVariable_methods(root_module, root_module['ns3::LogNormalRandomVariable']) register_Ns3LteAmc_methods(root_module, root_module['ns3::LteAmc']) register_Ns3LteAnr_methods(root_module, root_module['ns3::LteAnr']) register_Ns3LteControlMessage_methods(root_module, root_module['ns3::LteControlMessage']) register_Ns3LteEnbMac_methods(root_module, root_module['ns3::LteEnbMac']) register_Ns3LteEnbRrc_methods(root_module, root_module['ns3::LteEnbRrc']) register_Ns3LteEnbRrcHandoverEventInfo_methods(root_module, root_module['ns3::LteEnbRrc::HandoverEventInfo']) register_Ns3LteFfrAlgorithm_methods(root_module, root_module['ns3::LteFfrAlgorithm']) register_Ns3LteHandoverAlgorithm_methods(root_module, root_module['ns3::LteHandoverAlgorithm']) register_Ns3LteHarqPhy_methods(root_module, root_module['ns3::LteHarqPhy']) register_Ns3LteInterference_methods(root_module, root_module['ns3::LteInterference']) register_Ns3LtePdcp_methods(root_module, root_module['ns3::LtePdcp']) register_Ns3LtePdcpStatus_methods(root_module, root_module['ns3::LtePdcp::Status']) register_Ns3LtePhy_methods(root_module, root_module['ns3::LtePhy']) register_Ns3LteRadioBearerInfo_methods(root_module, root_module['ns3::LteRadioBearerInfo']) register_Ns3LteRlc_methods(root_module, root_module['ns3::LteRlc']) register_Ns3LteRlcAm_methods(root_module, root_module['ns3::LteRlcAm']) register_Ns3LteRlcAmRetxPdu_methods(root_module, root_module['ns3::LteRlcAm::RetxPdu']) register_Ns3LteRlcSm_methods(root_module, root_module['ns3::LteRlcSm']) register_Ns3LteSignalingRadioBearerInfo_methods(root_module, root_module['ns3::LteSignalingRadioBearerInfo']) register_Ns3LteSpectrumPhy_methods(root_module, root_module['ns3::LteSpectrumPhy']) register_Ns3LteStatsCalculator_methods(root_module, root_module['ns3::LteStatsCalculator']) register_Ns3LteUeMac_methods(root_module, root_module['ns3::LteUeMac']) register_Ns3LteUePhy_methods(root_module, root_module['ns3::LteUePhy']) register_Ns3LteUePowerControl_methods(root_module, root_module['ns3::LteUePowerControl']) register_Ns3LteUeRrc_methods(root_module, root_module['ns3::LteUeRrc']) register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker']) register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue']) register_Ns3MatrixPropagationLossModel_methods(root_module, root_module['ns3::MatrixPropagationLossModel']) register_Ns3McStatsCalculator_methods(root_module, root_module['ns3::McStatsCalculator']) register_Ns3MibLteControlMessage_methods(root_module, root_module['ns3::MibLteControlMessage']) register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >']) register_Ns3MinMaxAvgTotalCalculator__Unsigned_long_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< unsigned long >']) register_Ns3MmWave3gppBuildingsPropagationLossModel_methods(root_module, root_module['ns3::MmWave3gppBuildingsPropagationLossModel']) register_Ns3MmWave3gppChannel_methods(root_module, root_module['ns3::MmWave3gppChannel']) register_Ns3MmWaveAmc_methods(root_module, root_module['ns3::MmWaveAmc']) register_Ns3MmWaveBeamforming_methods(root_module, root_module['ns3::MmWaveBeamforming']) register_Ns3MmWaveBearerStatsCalculator_methods(root_module, root_module['ns3::MmWaveBearerStatsCalculator']) register_Ns3MmWaveBearerStatsConnector_methods(root_module, root_module['ns3::MmWaveBearerStatsConnector']) register_Ns3MmWaveChannelMatrix_methods(root_module, root_module['ns3::MmWaveChannelMatrix']) register_Ns3MmWaveChannelRaytracing_methods(root_module, root_module['ns3::MmWaveChannelRaytracing']) register_Ns3MmWaveControlMessage_methods(root_module, root_module['ns3::MmWaveControlMessage']) register_Ns3MmWaveDciMessage_methods(root_module, root_module['ns3::MmWaveDciMessage']) register_Ns3MmWaveDlCqiMessage_methods(root_module, root_module['ns3::MmWaveDlCqiMessage']) register_Ns3MmWaveDlHarqFeedbackMessage_methods(root_module, root_module['ns3::MmWaveDlHarqFeedbackMessage']) register_Ns3MmWaveEnbMac_methods(root_module, root_module['ns3::MmWaveEnbMac']) register_Ns3MmWaveEnbMacReportBufferStatusParameters_methods(root_module, root_module['ns3::MmWaveEnbMac::ReportBufferStatusParameters']) register_Ns3MmWaveEnbMacTransmitPduParameters_methods(root_module, root_module['ns3::MmWaveEnbMac::TransmitPduParameters']) register_Ns3MmWaveEnbRrcProtocolIdeal_methods(root_module, root_module['ns3::MmWaveEnbRrcProtocolIdeal']) register_Ns3MmWaveHarqPhy_methods(root_module, root_module['ns3::MmWaveHarqPhy']) register_Ns3MmWaveHelper_methods(root_module, root_module['ns3::MmWaveHelper']) register_Ns3MmWaveLosTracker_methods(root_module, root_module['ns3::MmWaveLosTracker']) register_Ns3MmWaveLteEnbRrcProtocolReal_methods(root_module, root_module['ns3::MmWaveLteEnbRrcProtocolReal']) register_Ns3MmWaveLteUeRrcProtocolReal_methods(root_module, root_module['ns3::MmWaveLteUeRrcProtocolReal']) register_Ns3MmWaveMac_methods(root_module, root_module['ns3::MmWaveMac']) register_Ns3MmWaveMacScheduler_methods(root_module, root_module['ns3::MmWaveMacScheduler']) register_Ns3MmWaveMibMessage_methods(root_module, root_module['ns3::MmWaveMibMessage']) register_Ns3MmWavePhy_methods(root_module, root_module['ns3::MmWavePhy']) register_Ns3MmWavePhyMacCommon_methods(root_module, root_module['ns3::MmWavePhyMacCommon']) register_Ns3MmWavePhyRxTrace_methods(root_module, root_module['ns3::MmWavePhyRxTrace']) register_Ns3MmWavePointToPointEpcHelper_methods(root_module, root_module['ns3::MmWavePointToPointEpcHelper']) register_Ns3MmWaveRachPreambleMessage_methods(root_module, root_module['ns3::MmWaveRachPreambleMessage']) register_Ns3MmWaveRarMessage_methods(root_module, root_module['ns3::MmWaveRarMessage']) register_Ns3MmWaveRarMessageRar_methods(root_module, root_module['ns3::MmWaveRarMessage::Rar']) register_Ns3MmWaveSib1Message_methods(root_module, root_module['ns3::MmWaveSib1Message']) register_Ns3MmWaveSpectrumPhy_methods(root_module, root_module['ns3::MmWaveSpectrumPhy']) register_Ns3MmWaveSpectrumSignalParametersDlCtrlFrame_methods(root_module, root_module['ns3::MmWaveSpectrumSignalParametersDlCtrlFrame']) register_Ns3MmWaveTdmaDciMessage_methods(root_module, root_module['ns3::MmWaveTdmaDciMessage']) register_Ns3MmWaveUeMac_methods(root_module, root_module['ns3::MmWaveUeMac']) register_Ns3MmWaveUePhy_methods(root_module, root_module['ns3::MmWaveUePhy']) register_Ns3MmWaveUeRrcProtocolIdeal_methods(root_module, root_module['ns3::MmWaveUeRrcProtocolIdeal']) register_Ns3MmwaveSpectrumSignalParametersDataFrame_methods(root_module, root_module['ns3::MmwaveSpectrumSignalParametersDataFrame']) register_Ns3MobilityBuildingInfo_methods(root_module, root_module['ns3::MobilityBuildingInfo']) register_Ns3MobilityModel_methods(root_module, root_module['ns3::MobilityModel']) register_Ns3NakagamiPropagationLossModel_methods(root_module, root_module['ns3::NakagamiPropagationLossModel']) register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice']) register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector']) register_Ns3Node_methods(root_module, root_module['ns3::Node']) register_Ns3NormalRandomVariable_methods(root_module, root_module['ns3::NormalRandomVariable']) register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker']) register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue']) register_Ns3Packet_methods(root_module, root_module['ns3::Packet']) register_Ns3Params3gpp_methods(root_module, root_module['ns3::Params3gpp']) register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable']) register_Ns3PointerChecker_methods(root_module, root_module['ns3::PointerChecker']) register_Ns3PointerValue_methods(root_module, root_module['ns3::PointerValue']) register_Ns3QueueItem_methods(root_module, root_module['ns3::QueueItem']) register_Ns3RachPreambleLteControlMessage_methods(root_module, root_module['ns3::RachPreambleLteControlMessage']) register_Ns3RarLteControlMessage_methods(root_module, root_module['ns3::RarLteControlMessage']) register_Ns3RarLteControlMessageRar_methods(root_module, root_module['ns3::RarLteControlMessage::Rar']) register_Ns3RrcAsn1Header_methods(root_module, root_module['ns3::RrcAsn1Header']) register_Ns3RrcDlCcchMessage_methods(root_module, root_module['ns3::RrcDlCcchMessage']) register_Ns3RrcDlDcchMessage_methods(root_module, root_module['ns3::RrcDlDcchMessage']) register_Ns3RrcUlCcchMessage_methods(root_module, root_module['ns3::RrcUlCcchMessage']) register_Ns3RrcUlDcchMessage_methods(root_module, root_module['ns3::RrcUlDcchMessage']) register_Ns3Sib1LteControlMessage_methods(root_module, root_module['ns3::Sib1LteControlMessage']) register_Ns3SpectrumChannel_methods(root_module, root_module['ns3::SpectrumChannel']) register_Ns3StringChecker_methods(root_module, root_module['ns3::StringChecker']) register_Ns3StringValue_methods(root_module, root_module['ns3::StringValue']) register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue']) register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker']) register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue']) register_Ns3UintegerValue_methods(root_module, root_module['ns3::UintegerValue']) register_Ns3UlDciLteControlMessage_methods(root_module, root_module['ns3::UlDciLteControlMessage']) register_Ns3Vector2DChecker_methods(root_module, root_module['ns3::Vector2DChecker']) register_Ns3Vector2DValue_methods(root_module, root_module['ns3::Vector2DValue']) register_Ns3Vector3DChecker_methods(root_module, root_module['ns3::Vector3DChecker']) register_Ns3Vector3DValue_methods(root_module, root_module['ns3::Vector3DValue']) register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker']) register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue']) register_Ns3AntennaArrayModel_methods(root_module, root_module['ns3::AntennaArrayModel']) register_Ns3BsrLteControlMessage_methods(root_module, root_module['ns3::BsrLteControlMessage']) register_Ns3BuildingsObstaclePropagationLossModel_methods(root_module, root_module['ns3::BuildingsObstaclePropagationLossModel']) register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Ns3ObjectBase___star___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Bool_Bool_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, bool, bool, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Const_ns3SpectrumValue___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, const ns3::SpectrumValue &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3EpcUeNasState_Ns3EpcUeNasState_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::EpcUeNas::State, ns3::EpcUeNas::State, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3PhyReceptionStatParameters_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::PhyReceptionStatParameters, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3PhyTransmissionStatParameters_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::PhyTransmissionStatParameters, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3MobilityModel__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::MobilityModel>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3Packet__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3PacketBurst__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::PacketBurst>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3QueueDiscItem__gt___Const_char___star___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::QueueDiscItem>, const char *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3QueueDiscItem__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::QueueDiscItem>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Const_ns3Address___amp___Ns3NetDevicePacketType_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Packet__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3RxPacketTraceParams_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::RxPacketTraceParams, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Time_Ns3Time_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Time, ns3::Time, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_int_Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_int_Unsigned_int_Unsigned_short_Unsigned_char_Unsigned_short_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned int, unsigned int, unsigned short, unsigned char, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_int_Unsigned_int_Unsigned_short_Unsigned_char_Unsigned_short_Unsigned_char_Unsigned_short_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned int, unsigned int, unsigned short, unsigned char, unsigned short, unsigned char, unsigned short, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_long_Ns3SpectrumValue___amp___Ns3SpectrumValue___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned long, ns3::SpectrumValue &, ns3::SpectrumValue &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_long_Unsigned_long_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned long, unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_long_Unsigned_short_Long_double_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned long, unsigned short, long double, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_long_Unsigned_short_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned long, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_long_Unsigned_short_Unsigned_short_Ns3LteRrcSapMeasurementReport_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned long, unsigned short, unsigned short, ns3::LteRrcSap::MeasurementReport, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_long_Unsigned_short_Unsigned_short_Ns3LteUeRrcState_Ns3LteUeRrcState_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned long, unsigned short, unsigned short, ns3::LteUeRrc::State, ns3::LteUeRrc::State, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_long_Unsigned_short_Unsigned_short_Ns3UeManagerState_Ns3UeManagerState_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned long, unsigned short, unsigned short, ns3::UeManager::State, ns3::UeManager::State, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_long_Unsigned_short_Unsigned_short_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned long, unsigned short, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_long_Unsigned_short_Unsigned_short_Unsigned_short_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned long, unsigned short, unsigned short, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Ns3Ptr__lt__ns3SpectrumValue__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, ns3::Ptr<ns3::SpectrumValue>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_char_Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned char, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_char_Unsigned_int_Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned char, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_char_Unsigned_int_Unsigned_long_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned char, unsigned int, unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_short_Double_Double_Bool_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned short, double, double, bool, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_short_Double_Double_Unsigned_char_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned short, double, double, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_short_Double_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned short, double, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_short_Double_Unsigned_char_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned short, double, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_short_Ns3LteUePhyState_Ns3LteUePhyState_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned short, ns3::LteUePhy::State, ns3::LteUePhy::State, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_short_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3CallbackImpl__Void_Unsigned_short_Unsigned_short_Unsigned_int_Unsigned_char_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned short, unsigned short, unsigned int, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >']) register_Ns3DlCqiLteControlMessage_methods(root_module, root_module['ns3::DlCqiLteControlMessage']) register_Ns3DlDciLteControlMessage_methods(root_module, root_module['ns3::DlDciLteControlMessage']) register_Ns3DlHarqFeedbackLteControlMessage_methods(root_module, root_module['ns3::DlHarqFeedbackLteControlMessage']) register_Ns3HandoverPreparationInfoHeader_methods(root_module, root_module['ns3::HandoverPreparationInfoHeader']) register_Ns3LteDataRadioBearerInfo_methods(root_module, root_module['ns3::LteDataRadioBearerInfo']) register_Ns3LteEnbPhy_methods(root_module, root_module['ns3::LteEnbPhy']) register_Ns3LteNetDevice_methods(root_module, root_module['ns3::LteNetDevice']) register_Ns3McUeNetDevice_methods(root_module, root_module['ns3::McUeNetDevice']) register_Ns3MeasurementReportHeader_methods(root_module, root_module['ns3::MeasurementReportHeader']) register_Ns3MmWaveBsrMessage_methods(root_module, root_module['ns3::MmWaveBsrMessage']) register_Ns3MmWaveEnbPhy_methods(root_module, root_module['ns3::MmWaveEnbPhy']) register_Ns3MmWaveFlexTtiMacScheduler_methods(root_module, root_module['ns3::MmWaveFlexTtiMacScheduler']) register_Ns3MmWaveFlexTtiMaxRateMacScheduler_methods(root_module, root_module['ns3::MmWaveFlexTtiMaxRateMacScheduler']) register_Ns3MmWaveFlexTtiMaxWeightMacScheduler_methods(root_module, root_module['ns3::MmWaveFlexTtiMaxWeightMacScheduler']) register_Ns3MmWaveFlexTtiPfMacScheduler_methods(root_module, root_module['ns3::MmWaveFlexTtiPfMacScheduler']) register_Ns3MmWaveNetDevice_methods(root_module, root_module['ns3::MmWaveNetDevice']) register_Ns3MmWaveUeNetDevice_methods(root_module, root_module['ns3::MmWaveUeNetDevice']) register_Ns3QueueDiscItem_methods(root_module, root_module['ns3::QueueDiscItem']) register_Ns3RrcConnectToMmWaveHeader_methods(root_module, root_module['ns3::RrcConnectToMmWaveHeader']) register_Ns3RrcConnectionReconfigurationCompleteHeader_methods(root_module, root_module['ns3::RrcConnectionReconfigurationCompleteHeader']) register_Ns3RrcConnectionReconfigurationHeader_methods(root_module, root_module['ns3::RrcConnectionReconfigurationHeader']) register_Ns3RrcConnectionReestablishmentCompleteHeader_methods(root_module, root_module['ns3::RrcConnectionReestablishmentCompleteHeader']) register_Ns3RrcConnectionReestablishmentHeader_methods(root_module, root_module['ns3::RrcConnectionReestablishmentHeader']) register_Ns3RrcConnectionReestablishmentRejectHeader_methods(root_module, root_module['ns3::RrcConnectionReestablishmentRejectHeader']) register_Ns3RrcConnectionReestablishmentRequestHeader_methods(root_module, root_module['ns3::RrcConnectionReestablishmentRequestHeader']) register_Ns3RrcConnectionRejectHeader_methods(root_module, root_module['ns3::RrcConnectionRejectHeader']) register_Ns3RrcConnectionReleaseHeader_methods(root_module, root_module['ns3::RrcConnectionReleaseHeader']) register_Ns3RrcConnectionRequestHeader_methods(root_module, root_module['ns3::RrcConnectionRequestHeader']) register_Ns3RrcConnectionSetupCompleteHeader_methods(root_module, root_module['ns3::RrcConnectionSetupCompleteHeader']) register_Ns3RrcConnectionSetupHeader_methods(root_module, root_module['ns3::RrcConnectionSetupHeader']) register_Ns3RrcConnectionSwitchHeader_methods(root_module, root_module['ns3::RrcConnectionSwitchHeader']) register_Ns3RrcNotifySecondaryConnectedHeader_methods(root_module, root_module['ns3::RrcNotifySecondaryConnectedHeader']) register_Ns3LteEnbNetDevice_methods(root_module, root_module['ns3::LteEnbNetDevice']) register_Ns3MmWaveEnbNetDevice_methods(root_module, root_module['ns3::MmWaveEnbNetDevice']) register_Ns3ConfigMatchContainer_methods(root_module, root_module['ns3::Config::MatchContainer']) register_Ns3HashImplementation_methods(root_module, root_module['ns3::Hash::Implementation']) register_Ns3HashFunctionFnv1a_methods(root_module, root_module['ns3::Hash::Function::Fnv1a']) register_Ns3HashFunctionHash32_methods(root_module, root_module['ns3::Hash::Function::Hash32']) register_Ns3HashFunctionHash64_methods(root_module, root_module['ns3::Hash::Function::Hash64']) register_Ns3HashFunctionMurmur3_methods(root_module, root_module['ns3::Hash::Function::Murmur3']) return
def visualize_generic_dataset(base_dir, dataset_json): from stemseg.utils.vis import overlay_mask_on_image, create_color_map (seqs, meta_info) = parse_generic_video_dataset(base_dir, dataset_json) category_names = meta_info['category_labels'] cmap = create_color_map().tolist() cv2.namedWindow('Image', cv2.WINDOW_NORMAL) for seq in seqs: if (len(seq) > 100): frame_idxes = list(range(100, 150)) else: frame_idxes = None images = seq.load_images(frame_idxes) masks = seq.load_masks(frame_idxes) category_labels = seq.category_labels print('[COLOR NAME] -> [CATEGORY NAME]') color_key_printed = False for (image_t, masks_t) in zip(images, masks): for (i, (mask, cat_label)) in enumerate(zip(masks_t, category_labels), 1): image_t = overlay_mask_on_image(image_t, mask, mask_color=cmap[i]) if (not color_key_printed): print('{} -> {}'.format(cmap[i], category_names[cat_label])) color_key_printed = True cv2.imshow('Image', image_t) if (cv2.waitKey(0) == 113): exit(0)
def normalize_vertices(pc): centroid = np.mean(pc, axis=0) pc = (pc - centroid) m = np.max(np.sqrt(np.sum((pc ** 2), axis=1))) pc = (pc / m) return pc
def get_lstm_grad(xs_np, h0_np, c0_np, w0_np, w_np, b_np, dy, dh, dc, num_layers=1, dropout=0.0, bidirectional=False, training=True, **kw): num_directions = (2 if bidirectional else 1) seq_len = xs_np.shape[0] batch_size = xs_np.shape[1] hidden_size = h0_np.shape[3] xs = nn.Variable.from_numpy_array(xs_np, need_grad=True) h0 = nn.Variable.from_numpy_array(h0_np, need_grad=True) c0 = nn.Variable.from_numpy_array(c0_np, need_grad=True) w0 = nn.Variable.from_numpy_array(w0_np, need_grad=True) w = None b = None with_bias = False if (num_layers > 1): w = nn.Variable.from_numpy_array(w_np, need_grad=True) if (type(b_np) == np.ndarray): b = nn.Variable.from_numpy_array(b_np, need_grad=True) with_bias = True xs.grad.zero() h0.grad.zero() c0.grad.zero() w0.grad.zero() if (num_layers > 1): w.grad.zero() if with_bias: b.grad.zero() (ys, hn, cn) = _create_fixed_length_lstm(xs, h0, c0, w0, w, b, num_layers, num_directions, with_bias) dummy = F.sink(ys, hn, cn, one_input_grad=False) dummy.forward() ys.g = np.reshape(dy, ys.shape) hn.g = dh cn.g = dc dummy.backward() if ((num_layers > 1) and with_bias): return np.concatenate((xs.g.flat, h0.g.flat, c0.g.flat, w0.g.flat, w.g.flat, b.g.flat)) elif ((num_layers > 1) and (not with_bias)): return np.concatenate((xs.g.flat, h0.g.flat, c0.g.flat, w0.g.flat, w.g.flat)) elif ((num_layers == 1) and with_bias): return np.concatenate((xs.g.flat, h0.g.flat, c0.g.flat, w0.g.flat, b.g.flat)) else: return np.concatenate((xs.g.flat, h0.g.flat, c0.g.flat, w0.g.flat))
def main(_): with open(FLAGS.vocab, 'r') as lines: orig_vocab_sz = sum((1 for _ in lines)) shard_sz = FLAGS.shard_size vocab_sz = (orig_vocab_sz - (orig_vocab_sz % shard_sz)) nshards = (vocab_sz / shard_sz) print(('vocab size is %d (originally %d), %d %dx%d-element shards' % (vocab_sz, orig_vocab_sz, (nshards * nshards), shard_sz, shard_sz))) if (FLAGS.output_dir and (not os.path.isdir(FLAGS.output_dir))): os.makedirs(FLAGS.output_dir) with open(FLAGS.input, 'r') as coocs: (shard_files, marginals) = make_shard_files(coocs, nshards, vocab_sz) filename = os.path.join(FLAGS.output_dir, 'shards.recs') with tf.python_io.TFRecordWriter(filename) as writer: ix = 0 for ((row, col), fh) in shard_files.iteritems(): ix += 1 sys.stdout.write(('\rwriting shard %d/%d' % (ix, len(shard_files)))) sys.stdout.flush() fh.seek(0) buf = fh.read() os.unlink(fh.name) fh.close() coocs = [shard_cooc_fmt.unpack_from(buf, off) for off in range(0, len(buf), shard_cooc_fmt.size)] coocs.sort(key=(lambda kv: kv[0])) def _int64s(xs): return tf.train.Feature(int64_list=tf.train.Int64List(value=list(xs))) def _floats(xs): return tf.train.Feature(float_list=tf.train.FloatList(value=list(xs))) example = tf.train.Example(features=tf.train.Features(feature={'global_row': _int64s(((row + (nshards * i)) for i in range(shard_sz))), 'global_col': _int64s(((col + (nshards * i)) for i in range(shard_sz))), 'sparse_local_row': _int64s(((pos / shard_sz) for (pos, _) in coocs)), 'sparse_local_col': _int64s(((pos % shard_sz) for (pos, _) in coocs)), 'sparse_value': _floats((cnt for (_, cnt) in coocs))})) writer.write(example.SerializeToString()) print('\nwriting marginals...') with open(os.path.join(FLAGS.output_dir, 'marginals.txt'), 'w') as fh: for cnt in marginals: fh.write(('%0.1f\n' % cnt)) print('done!')
def test_find_spans(): raw = ['u', 'n', 'b', 'a', 'n', ' ', 'm', 'o', 'x', ' ', 'o', 'p', 'a', 'l'] assert (utils.find_spans(raw) == [(0, 14)]) raw = ['u', 'n', 'b', 'a', 'n', ' ', 'm', 'o', 'x', ' ', 'o', 'p', 'a', 'l', '<PAD>'] assert (utils.find_spans(raw) == [(0, 14)]) raw = ['<PAD>', 'u', 'n', 'b', 'a', 'n', ' ', 'm', 'o', 'x', ' ', 'o', 'p', 'a', 'l', '<PAD>'] assert (utils.find_spans(raw) == [(1, 15)]) raw = ['<PAD>', 'u', 'n', 'b', 'a', 'n', ' ', 'm', 'o', 'x', ' ', 'o', 'p', 'a', 'l'] assert (utils.find_spans(raw) == [(1, 15)]) raw = ['<PAD>', 'u', 'n', 'b', 'a', 'n', '<PAD>', 'm', 'o', 'x', ' ', 'o', 'p', 'a', 'l'] assert (utils.find_spans(raw) == [(1, 6), (7, 15)])
def hcopy(from_path: str, to_path: str) -> bool: if to_path.startswith('hdfs'): if from_path.startswith('hdfs'): os.system('{} dfs -cp -f {} {}'.format(HADOOP_BIN, from_path, to_path)) else: os.system('{} dfs -copyFromLocal -f {} {}'.format(HADOOP_BIN, from_path, to_path)) elif from_path.startswith('hdfs'): os.system('{} dfs -text {} > {}'.format(HADOOP_BIN, from_path, to_path)) else: shutil.copy(from_path, to_path) return True
.expansion class ExpandIrecvMPI(ExpandTransformation): environments = [environments.mpi.MPI] def expansion(node, parent_state, parent_sdfg, n=None, **kwargs): ((buffer, count_str, buffer_offset, ddt), src, tag) = node.validate(parent_sdfg, parent_state) mpi_dtype_str = dace.libraries.mpi.utils.MPI_DDT(buffer.dtype.base_type) if (buffer.dtype.veclen > 1): raise NotImplementedError comm = 'MPI_COMM_WORLD' if node.grid: comm = f'__state->{node.grid}_comm' code = '' if (ddt is not None): code = f'''static MPI_Datatype newtype; static int init=1; if (init) {{ MPI_Type_vector({ddt['count']}, {ddt['blocklen']}, {ddt['stride']}, {ddt['oldtype']}, &newtype); MPI_Type_commit(&newtype); init = 0; }} ''' mpi_dtype_str = 'newtype' count_str = '1' buffer_offset = 0 code += f'MPI_Irecv(_buffer, {count_str}, {mpi_dtype_str}, int(_src), int(_tag), {comm}, _request);' if (ddt is not None): code += f'''// MPI_Type_free(&newtype); ''' tasklet = dace.sdfg.nodes.Tasklet(node.name, node.in_connectors, node.out_connectors, code, language=dace.dtypes.Language.CPP) conn = tasklet.out_connectors conn = {c: (dtypes.pointer(dtypes.opaque('MPI_Request')) if (c == '_request') else t) for (c, t) in conn.items()} tasklet.out_connectors = conn return tasklet
class ShapeNetCoreTFRecordWriter(): def __init__(self, object_category: str='Airplane', n_sampled_points: int=1024, viz_samples=None) -> None: self.dataset_path = '/tmp/.keras/datasets/PartAnnotation' if ((not os.path.exists(self.dataset_path)) or (os.listdir(self.dataset_path) == 0)): self._get_files() self.metadata = self._load_metadata() if (object_category not in self.metadata.keys()): raise KeyError(('Not a valid Shapenet Object. Must be one of ' + str(self.metadata.keys()))) else: self.object_category = object_category self.viz_samples = viz_samples self.n_sampled_points = n_sampled_points (self.point_clouds, self.test_point_clouds) = ([], []) (self.point_cloud_labels, self.point_cloud_dataframes) = ([], []) self.labels = self.metadata[self.object_category]['lables'] self.colors = self.metadata[self.object_category]['colors'] def _get_files(self): dataset_url = ' keras.utils.get_file(fname='shapenet.zip', origin=dataset_url, cache_subdir='datasets', hash_algorithm='auto', extract=True, archive_format='auto', cache_dir='datasets') def _load_metadata(self): with open(os.path.join(self.dataset_path, 'metadata.json')) as json_file: metadata = json.load(json_file) return metadata def _sample_point_clouds(self): for index in tqdm(range(len(self.point_clouds))): current_point_cloud = self.point_clouds[index] current_label_cloud = self.point_cloud_labels[index] n_points = len(current_point_cloud) sampled_indices = random.sample(list(range(n_points)), self.n_sampled_points) sampled_point_cloud = np.array([current_point_cloud[i] for i in sampled_indices]) sampled_label_cloud = np.array([current_label_cloud[i] for i in sampled_indices]) norm_point_cloud = (sampled_point_cloud - np.mean(sampled_point_cloud, axis=0)) norm_point_cloud /= np.max(np.linalg.norm(norm_point_cloud, axis=1)) self.point_clouds[index] = sampled_point_cloud self.point_cloud_labels[index] = sampled_label_cloud def load_data(self, limit=None) -> None: points_dir = os.path.join(self.dataset_path, '{}/points'.format(self.metadata[self.object_category]['directory'])) labels_dir = os.path.join(self.dataset_path, '{}/points_label'.format(self.metadata[self.object_category]['directory'])) points_files = glob(os.path.join(points_dir, '*.pts')) if (limit is not None): points_files = points_files[:limit] for point_file in tqdm(points_files): point_cloud = np.loadtxt(point_file) if (point_cloud.shape[0] < self.n_sampled_points): continue file_id = point_file.split('/')[(- 1)].split('.')[0] (label_data, num_labels) = ({}, 0) for label in self.labels: label_file = os.path.join(labels_dir, label, (file_id + '.seg')) if os.path.exists(label_file): label_data[label] = np.loadtxt(label_file).astype('float32') num_labels = len(label_data[label]) try: label_map = (['none'] * num_labels) for label in self.labels: for (i, data) in enumerate(label_data[label]): label_map[i] = (label if (data == 1) else label_map[i]) label_data = [(self.labels.index(label) if (label != 'none') else len(self.labels)) for label in label_map] label_data = keras.utils.to_categorical(label_data, num_classes=(len(self.labels) + 1)) self.point_clouds.append(point_cloud) self.point_cloud_labels.append(label_data) except KeyError: self.test_point_clouds.append(point_cloud) self._sample_point_clouds() def _write_tfrecords_with_labels(self, point_clouds, label_clouds, samples_per_shard: int, tfrecord_dir: str, split: str): num_tfrecords = (len(point_clouds) // samples_per_shard) if (len(point_clouds) % samples_per_shard): num_tfrecords += 1 logging.info(f'num_tfrecords: {num_tfrecords}') point_cloud_shards = split_list(point_clouds, samples_per_shard) label_cloud_shards = split_list(label_clouds, samples_per_shard) (lower_limit, upper_limit) = (0, samples_per_shard) for index in range(num_tfrecords): point_cloud_shard = point_cloud_shards[index] label_cloud_shard = label_cloud_shards[index] file_name = 'shapenet-{}-{}-{:04d}-{:04d}.tfrec'.format(self.n_sampled_points, split, lower_limit, upper_limit) lower_limit += samples_per_shard upper_limit += samples_per_shard logging.info(f'Writing TFRecord File {file_name}') with tf.io.TFRecordWriter(os.path.join(tfrecord_dir, self.object_category, split, file_name)) as writer: for sample_index in tqdm(range(len(point_cloud_shard))): example = tf.train.Example(features=tf.train.Features(feature=create_example(point_cloud_shard[sample_index], label_cloud_shard[sample_index]))) writer.write(example.SerializeToString()) def write_tfrecords(self, val_split: float, samples_per_shard: int, tfrecord_dir: str): make_dir(tfrecord_dir) make_dir(os.path.join(tfrecord_dir, self.object_category)) make_dir(os.path.join(tfrecord_dir, self.object_category, 'train')) make_dir(os.path.join(tfrecord_dir, self.object_category, 'val')) split_index = int((len(self.point_clouds) * (1 - val_split))) train_point_clouds = self.point_clouds[:split_index] train_label_clouds = self.point_cloud_labels[:split_index] val_point_clouds = self.point_clouds[split_index:] val_label_clouds = self.point_cloud_labels[split_index:] logging.info('Creating Train TFRecords...') self._write_tfrecords_with_labels(train_point_clouds, train_label_clouds, samples_per_shard, tfrecord_dir, 'train') logging.info('Creating Validation TFRecords...') self._write_tfrecords_with_labels(val_point_clouds, val_label_clouds, samples_per_shard, tfrecord_dir, 'val')
def invalid_rate(value: str) -> UsageError: return UsageError(f'Invalid rate limit value: `{value}`. Should be in form `limit/interval`. Example: `10/m` for 10 requests per minute.')
def _draw_rect(img, rect, color, thickness=2): p1 = (int(rect[0]), int(rect[1])) p2 = (int((rect[0] + rect[2])), int((rect[1] + rect[3]))) cv2.rectangle(img, p1, p2, color, thickness)
def add_arguments_data(parser): parser.add_argument('--random-crop', type=int, default=2) parser.add_argument('--num-class', type=int, default=10) parser.add_argument('--no-data-aug', action='store_true') parser.add_argument('--test-batch-size', type=int) parser.add_argument('--batch-size', type=int)
def _kmeans_plusplus(X, n_clusters, x_squared_norms, sample_weight, random_state, n_local_trials=None): (n_samples, n_features) = X.shape centers = np.empty((n_clusters, n_features), dtype=X.dtype) if (n_local_trials is None): n_local_trials = (2 + int(np.log(n_clusters))) center_id = random_state.choice(n_samples, p=(sample_weight / sample_weight.sum())) indices = np.full(n_clusters, (- 1), dtype=int) if sp.issparse(X): centers[0] = X[[center_id]].toarray() else: centers[0] = X[center_id] indices[0] = center_id closest_dist_sq = _euclidean_distances(centers[(0, np.newaxis)], X, Y_norm_squared=x_squared_norms, squared=True) current_pot = (closest_dist_sq sample_weight) for c in range(1, n_clusters): rand_vals = (random_state.uniform(size=n_local_trials) * current_pot) candidate_ids = np.searchsorted(stable_cumsum((sample_weight * closest_dist_sq)), rand_vals) np.clip(candidate_ids, None, (closest_dist_sq.size - 1), out=candidate_ids) distance_to_candidates = _euclidean_distances(X[candidate_ids], X, Y_norm_squared=x_squared_norms, squared=True) np.minimum(closest_dist_sq, distance_to_candidates, out=distance_to_candidates) candidates_pot = (distance_to_candidates sample_weight.reshape((- 1), 1)) best_candidate = np.argmin(candidates_pot) current_pot = candidates_pot[best_candidate] closest_dist_sq = distance_to_candidates[best_candidate] best_candidate = candidate_ids[best_candidate] if sp.issparse(X): centers[c] = X[[best_candidate]].toarray() else: centers[c] = X[best_candidate] indices[c] = best_candidate return (centers, indices)
def detect_file_discrepancies(session_name, data_dir): logger = logging.getLogger(__name__) base_dir = osp.join(data_dir, session_name) for object_dir in next(os.walk(base_dir))[1]: object_dir = osp.join(base_dir, object_dir) object_name_filename = osp.join(object_dir, 'object_name.txt') try: with open(object_name_filename, 'r') as f: object_name = f.readline().strip() except IOError: logger.warn('Skipping {:s}'.format(object_dir)) continue pose_dir = osp.join(object_dir, 'poses') pose_count = 0 for fname in next(os.walk(pose_dir))[(- 1)]: if ('camera_pose' not in fname): continue pose_count += 1 thermal_dir = osp.join(object_dir, 'thermal_images') thermal_count = 0 for fname in next(os.walk(thermal_dir))[(- 1)]: if (('.png' not in fname) or ('mask' in fname)): continue thermal_count += 1 if (pose_count != thermal_count): logger.warning('{:s} has unequal number of poses and thermal images'.format(object_dir))
def load_local_or_remote_file(filepath, file_type=None): local_path = local_path_from_s3_or_local_path(filepath) if (local_path is None): return None if (file_type is None): extension = local_path.split('.')[(- 1)] if (extension == 'npy'): file_type = NUMPY else: file_type = PICKLE else: file_type = PICKLE if (file_type == NUMPY): object = np.load(open(local_path, 'rb')) elif (file_type == JOBLIB): object = joblib.load(local_path) else: object = pickle.load(open(local_path, 'rb')) print('loaded', local_path) return object
class ExtraCloseTreeError(ValueError): def __init__(self, line_num): super().__init__(('Found a broken tree (extra close brackets). Tree started on line %d' % line_num)) self.line_num = line_num