MCPcopy Create free account

hub / github.com/benatorc/PA-Graph-Transformer / functions

Functions113 in github.com/benatorc/PA-Graph-Transformer

↓ 14 callersMethodadd_stat
(self, stat_name, val, norm=1)
utils/data_utils.py:19
↓ 10 callersFunctiononek_unk_encoding
Returns a one-hot encoding of the given feature.
graph/mol_features.py:67
↓ 8 callersFunctionget_loader
(raw_data, split_indices, args, shuffle=False, num_workers=5, batch_size=0)
datasets/mol_dataset.py:39
↓ 8 callersFunctionget_shortest_paths
Returns the shortest paths for the given rd_mol. For every pair of atoms, if they are connected by a path <= max_path_length the atoms on
preprocess/shortest_paths.py:37
↓ 6 callersFunctionordered_pair
(pair)
parse/generate_ring_data.py:12
↓ 4 callersFunctionassert_dict_equal
(source, target)
preprocess/test_shortest_paths.py:7
↓ 4 callersMethodget_stats
(self)
utils/data_utils.py:25
↓ 3 callersFunctioncreate_dirs
(args, output_dir)
arguments.py:91
↓ 2 callersMethodadd_bond
(self, bond)
graph/mol_graph.py:41
↓ 2 callersFunctiongenerate_complex_ring_data
(smiles, n_pos, n_neg)
parse/generate_ring_data.py:133
↓ 2 callersFunctionget_args
()
arguments.py:6
↓ 2 callersFunctionget_grad_norm
(model, debug=False)
utils/train_utils.py:7
↓ 2 callersFunctionget_neigh_if_conjugated
(mol, atom_idx, ring)
parse/generate_ring_data.py:164
↓ 2 callersFunctionget_non_ring_neighbor
(mol, atom_idx, ring)
parse/generate_ring_data.py:96
↓ 2 callersFunctionget_num_path_features
Returns the number of path features for the model.
utils/path_utils.py:78
↓ 2 callersMethodindex_select_nei
(self, input, dim, index)
modules/conv_layer.py:31
↓ 2 callersFunctioninit_model
(args, n_classes)
train/train_prop.py:15
↓ 2 callersFunctioninit_model
(args, n_classes)
train/train_ring.py:16
↓ 2 callersFunctionis_conjugated_path
(mol, path_atoms)
parse/generate_ring_data.py:124
↓ 2 callersFunctionload_datasets
(raw_data, split_idx, args)
train/train_prop.py:23
↓ 2 callersFunctionload_datasets
(raw_data, split_idx, args, n_workers=5)
train/train_ring.py:24
↓ 2 callersFunctiontest_model
(dataset_loaders, model, stat_names, train_func, args, inference_func=None)
train/train_base.py:101
↓ 2 callersFunctiontrain_model
(dataset_loaders, model, optimizer, stat_names, selection_stat, train_func, args, select_highe
train/train_base.py:7
↓ 1 callersMethod_parse_molecules
Turn the smiles into atom and bonds through rdkit. Every bond is recorded as two directional bonds, and for each atom, keep track
graph/mol_graph.py:97
↓ 1 callersMethodaggregate_atom_h
(self, atom_h, scope)
models/prop_predictor.py:29
↓ 1 callersMethodavg_attn
(self, attn_probs, n_heads, batch_sz, max_atoms)
models/mol_transformer.py:82
↓ 1 callersMethodcompute_attn_probs
(self, attn_input, attn_mask, layer_idx, eps=1e-20)
models/mol_transformer.py:53
↓ 1 callersMethodcompute_nei_score
(self, attn_probs, path_mask)
models/mol_transformer.py:75
↓ 1 callersFunctiongenerate_ring_data
(smiles, n_pos, n_neg)
parse/generate_ring_data.py:30
↓ 1 callersFunctiongenerate_ring_position_data
(smiles, max_samples)
parse/generate_ring_data.py:77
↓ 1 callersFunctionget_args
()
utils/test_path_utils.py:11
↓ 1 callersFunctionget_atom_frag
Returns the fragment the atom belongs to.
preprocess/shortest_paths.py:50
↓ 1 callersMethodget_atom_inputs
Constructs only the atom inputs for the batch of molecules.
graph/mol_graph.py:144
↓ 1 callersMethodget_attn_input
(self, atom_h, path_input, max_atoms)
models/mol_transformer.py:44
↓ 1 callersMethodget_graph_inputs
Constructs the graph inputs for the conv net. Returns: A tuple of tensors/numpy arrays that contains the input to the GCN.
graph/mol_graph.py:160
↓ 1 callersFunctionget_path_atoms
Given a pair of atom indices, returns the list of atoms on the path. Args: atom_1: The start atom on the path. atom_2: The end at
utils/path_utils.py:91
↓ 1 callersFunctionget_path_features
Returns a feature array for the path. Args: rd_mol: The rdkit mol object, used to extract features. path_atoms: A list of atoms i
utils/path_utils.py:138
↓ 1 callersFunctionget_ring_features
(ring_dict, atom_pair)
utils/path_utils.py:170
↓ 1 callersFunctionget_ring_paths
(rd_mol)
preprocess/shortest_paths.py:16
↓ 1 callersFunctionmain
()
parse/split_data.py:27
↓ 1 callersFunctionmain
()
parse/generate_ring_data.py:232
↓ 1 callersFunctionmain
()
train/train_prop.py:43
↓ 1 callersFunctionmain
()
train/train_ring.py:44
↓ 1 callersFunctionmain
()
preprocess/shortest_paths.py:114
↓ 1 callersFunctionordered_pair
(a1, a2)
utils/path_utils.py:8
↓ 1 callersFunctionordered_pair
(a1, a2)
preprocess/shortest_paths.py:9
↓ 1 callersFunctionparse_mol
(data_dir, max_path_length)
preprocess/shortest_paths.py:97
↓ 1 callersFunctionread_mol_smiles
(data_path)
preprocess/shortest_paths.py:85
↓ 1 callersFunctionread_smiles
(data_path)
parse/generate_ring_data.py:20
↓ 1 callersFunctionread_smiles_from_file
(data_path)
utils/data_utils.py:47
↓ 1 callersFunctionsplit_data
Split the data in smiles_list to train, dev and test
parse/split_data.py:8
↓ 1 callersFunctionwrite_args
(args)
arguments.py:100
↓ 1 callersFunctionwrite_ring_output
(write_file, smiles_list, atom_pair_idx, labels, preds, n_classes=1)
train/train_ring.py:197
Method__getitem__
(self, index)
datasets/mol_dataset.py:20
Method__init__
(self, args)
modules/attention.py:6
Method__init__
Creates graph conv layers for molecular graphs.
modules/conv_layer.py:9
Method__init__
(self, stat_names)
utils/data_utils.py:7
Method__init__
(self, raw_data, split_indices, args)
datasets/mol_dataset.py:9
Method__init__
(self, args, use_attn=False)
models/mol_conv_net.py:10
Method__init__
(self, args, n_classes=1)
models/atom_predictor.py:10
Method__init__
(self, args, n_classes=1)
models/prop_predictor.py:10
Method__init__
(self, args)
models/mol_transformer.py:11
Method__init__
Initialize the atom object to keep track of its attributes. Args: idx: The index of the atom in the original molecule.
graph/mol_graph.py:18
Method__init__
Initialize the bond object to keep track of its attributes.
graph/mol_graph.py:46
Method__init__
(self, atoms, bonds)
graph/mol_graph.py:59
Method__init__
Initialize the molecular graph inputs for the smiles list. Args: smiles_list: The input smiles strings in a list
graph/mol_graph.py:72
Method__len__
(self)
datasets/mol_dataset.py:35
Functionbackprop_grads
(model, optimizer, stats_tracker, args)
utils/train_utils.py:19
Functionbt_index_to_float
(bt_index)
graph/mol_features.py:36
Functioncombine_data
(data)
datasets/mol_dataset.py:43
Functioncompute_acc
(input_probs, target, n_classes=1)
utils/train_utils.py:29
Functioncompute_auc
(input_probs, target)
utils/train_utils.py:39
Functioncompute_max_atoms
Given the scopes for a batch of molecules, computes max atoms.
utils/model_utils.py:5
Functionconvert_to_2D
Convert back to 2D Args: input: A tensor of shape [batch size, max padding, # features] scope: A list of start/length indices for
utils/model_utils.py:60
Functionconvert_to_3D
Converts the input to a 3D batch matrix Args: input: A tensor of shape [# atoms, # features] scope: A list of start/length indice
utils/model_utils.py:14
Functioncreate_dir_if_not_exists
(dir_path)
utils/data_utils.py:112
Functiondict_to_dstr
Convert dictionary to a csv-friendly string.
utils/data_utils.py:128
Functiondict_to_pstr
Convert dictionary to a print-friendly string, sorted by key.
utils/data_utils.py:117
Methodforward
(self, atom_h, scope)
modules/attention.py:14
Methodforward
(self, graph_inputs)
modules/conv_layer.py:41
Methodforward
(self, mol_graph, stats_tracker=None)
models/mol_conv_net.py:22
Methodforward
(self, mol_graph, pair_idx, stats_tracker, output_attn=False)
models/atom_predictor.py:29
Methodforward
(self, mol_graph, stats_tracker, output_attn=False)
models/prop_predictor.py:43
Methodforward
(self, mol_graph, stats_tracker=None)
models/mol_transformer.py:88
Functionget_atom_features
Given an atom object, returns a numpy array of features.
graph/mol_features.py:74
Methodget_bond
(self, atom_1, atom_2)
graph/mol_graph.py:63
Functionget_bond_features
Given an bond object, returns a numpy array of features. bond can be None, in which case returns default features for a non-bond.
graph/mol_features.py:95
Functionget_bt_feature
Returns a one-hot vector representing the bond_type.
graph/mol_features.py:117
Functionget_bt_index
Returns the feature index for a particular bond type. Args: bond_type: Either a rdchem bond type object (can be None) or a float
graph/mol_features.py:53
Methodget_n_atoms
(self)
graph/mol_graph.py:93
Functionget_path_bond_feature
Given a rdkit bond object, returns the bond features for that bond. When the given input is none, returns a 0-vector
graph/mol_features.py:124
Functionget_path_input
(mols, shortest_paths, max_atoms, args, output_tensor=True)
utils/path_utils.py:15
Functionget_test_loader
(raw_data, split_idx, args)
train/train_prop.py:36
Functionget_test_loader
(raw_data, split_idx, args)
train/train_ring.py:37
Functionload_shortest_paths
(args)
utils/data_utils.py:101
Functionmap_equiv
(source_map, target_map)
utils/data_utils.py:136
Functionmerge_path_inputs
Merge path input matrices. Does not create CUDA tensors intentionally
utils/path_utils.py:57
Functionread_smiles_from_dir
(data_dir)
utils/data_utils.py:91
Functionread_smiles_multiclass
(data_path)
utils/data_utils.py:58
Functionread_smiles_ring_data
(data_path)
utils/data_utils.py:71
next →1–100 of 113, ranked by callers