Пример #1
0
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals

import os
import tempfile
import shutil
import numpy as np
import deepchem as dc
from deepchem.molnet import load_kaggle

###Load data###
shard_size = 2000
num_trials = 2
print("About to load MERCK data.")
KAGGLE_tasks, datasets, transformers = load_kaggle(shard_size=shard_size)
train_dataset, valid_dataset, test_dataset = datasets

print("Number of compounds in train set")
print(len(train_dataset))
print("Number of compounds in validation set")
print(len(valid_dataset))
print("Number of compounds in test set")
print(len(test_dataset))

all_results = []
for trial in range(num_trials):
  ###Create model###
  n_layers = 3
  nb_epoch = 100
  model = dc.models.MultitaskRegressor(
Пример #2
0
from __future__ import division
from __future__ import unicode_literals

import os
import numpy as np
import tempfile
import shutil
import deepchem as dc
from deepchem.molnet import load_kaggle

###Load data###
shard_size = 2000
num_trials = 2

print("About to load KAGGLE data.")
KAGGLE_tasks, datasets, transformers = load_kaggle(shard_size=shard_size)
train_dataset, valid_dataset, test_dataset = datasets

print("Number of compounds in train set")
print(len(train_dataset))
print("Number of compounds in validation set")
print(len(valid_dataset))
print("Number of compounds in test set")
print(len(test_dataset))

metric = dc.metrics.Metric(dc.metrics.pearson_r2_score, task_averager=np.mean)

###Create model###
n_layers = 3
nb_epoch = 100
n_features = train_dataset.get_data_shape()[0]