code
stringlengths
3
6.57k
keyid (string)
profile (dict)
key (string)
format(name)
format(name)
format(name, is_deleted['error'])
format(name)
setdefault('old', 'Stream {0} exists'.format(name)
setdefault('new', 'Stream {0} deleted'.format(name)
_add_changes(ret, changes_old, changes_new, comments)
join(comments)
rdBase.DisableLog('rdApp.*')
sys.path.append('../src/')
argparse.ArgumentParser(description='SMILES generation')
parser.add_argument('-fn','--filename', type=str, help='Path to the fine-tuning txt file', required=True)
parser.add_argument('-m','--model_path', type=str, help='Path to a pretrained model', required=True)
parser.add_argument('-v','--verbose', type=bool, help='Verbose', required=True)
int_to_smile(array, indices_token, pad_char)
str(int(x)
all_mols.append(''.join(new_mol)
replace(pad_char, '')
one_hot_encode(token_lists, n_chars)
np.zeros((len(token_lists)
len(token_lists[0])
enumerate(token_lists)
enumerate(token_list)
int(token)
sample(model, temp, start_char, end_char, max_len, indices_token, token_indices)
len(indices_token)
str(seed_token[0])
len(generated)
one_hot_encode([seed_token], n_chars)
model.predict(x_seed, verbose=0)
get_token_proba(logits, temp)
str(next_char_ind)
get_token_proba(preds, temp)
np.asarray(preds)
astype('float64')
np.log(preds)
np.exp(preds)
np.sum(exp_preds)
np.argmax(np.random.multinomial(1, probas, 1)
softmax(preds)
np.exp(preds)
np.sum(np.exp(preds)
time.time()
vars(parser.parse_args()
filename.split('/')
replace('.txt','')
configparser.ConfigParser()
config.read('parameters.ini')
print('\nSTART SAMPLING')
os.makedirs(save_path, exist_ok=True)
float(config['EXPERIMENTS']['temp'])
int(config['EXPERIMENTS']['n_sample'])
warnings.warn('You will sample more than 5000 SMILES; this will take a while')
int(config['PROCESSING']['max_len'])
model_path.split('/')
replace('.h5', '')
print(f'Sampling from model saved at epoch {epoch}')
load_model(model_path)
range(n_sample)
hp.save_obj(generated_smi, f'{save_path}{epoch}_{temp}')
time.time()
print(f'SAMPLING DONE for model from epoch {epoch} in {end-start:.2f} seconds')
VpcSecurityGroupCreateTask(object)
__init__(self, task=None)
torch.cuda.current_device()
torch.cuda.device_count()
print('Multiple GPUs detected! Turning off JIT.')
Concat(nn.Module)
__init__(self, nets, extra_params)
super()
__init__()
nn.ModuleList(nets)
forward(self, x)
torch.cat([net(x)
defaultdict(lambda: None)
PredictionModule(nn.Module)
The (c)
size (must be a multiple of 4)
ratios (one list per scale)
__init__(self, in_channels, out_channels=1024, aspect_ratios=[[1]], scales=[1], parent=None, index=0)
super()
__init__()
sum(len(x)
len(scales)
make_net(in_channels, cfg.extra_head_net)
Bottleneck(out_channels, out_channels // 4)
nn.Conv2d(out_channels, out_channels, kernel_size=1, bias=True)
nn.BatchNorm2d(out_channels)
nn.Conv2d(out_channels, self.num_priors * 4, **cfg.head_layer_params)
nn.Conv2d(out_channels, self.num_priors * self.num_classes, **cfg.head_layer_params)
nn.Conv2d(out_channels, self.num_priors * self.mask_dim, **cfg.head_layer_params)
nn.Conv2d(out_channels, self.num_priors, **cfg.head_layer_params)
nn.Conv2d(out_channels, self.num_priors * cfg.num_instance_coeffs, **cfg.head_layer_params)
make_extra(num_layers)
nn.Conv2d(out_channels, out_channels, kernel_size=3, padding=1)
nn.ReLU(inplace=True)
range(num_layers)