docstr: Constructs the graph architecture as specified in its config.
  
  This method creates the following Placeholders:
    mol_features: Molecule descriptor (e.g. fingerprint) tensor with shape
      batch_size x n_features.
docstr_tok: ["Constructs","the","graph","architecture","as","specified","in","its","config",".","This","method","creates","the","following","Placeholders",":","mol_features",":","Molecule","descriptor","(","e.g",".","fingerprint",")","tensor","with","shape","batch_size","x","n_features","."]
code: def build(self):
      """Constructs the graph architecture as specified in its config.
  
      This method creates the following Placeholders:
        mol_features: Molecule descriptor (e.g. fingerprint) tensor with shape
          batch_size x n_features.
      """
  
      layer_sizes = self.layer_sizes
      weight_init_stddevs = self.weight_init_stddevs
      bias_init_consts = self.bias_init_consts
      dropouts = self.dropouts
      lengths_set = {
          len(layer_sizes),
          len(weight_init_stddevs),
          len(bias_init_consts),
          len(dropouts),
      }
      assert (
          len(lengths_set) == 1
      ), "All layer params must have same length."
      n_layers = lengths_set.pop()
      assert n_layers > 0, "Must have some layers defined."
  
      prev_layer_size = self.n_features
      self.W_list = []
      self.b_list = []
      for i in range(n_layers):
          W_init = np.random.normal(
              0,
              weight_init_stddevs[i],
              (prev_layer_size, layer_sizes[i]),
          )
          W_init = torch.cuda.FloatTensor(W_init)
          self.W_list.append(
              torch.autograd.Variable(W_init, requires_grad=True)
          )
          b_init = np.full((layer_sizes[i],), bias_init_consts[i])
          b_init = torch.cuda.FloatTensor(b_init)
          self.b_list.append(
              torch.autograd.Variable(b_init, requires_grad=True)
          )
          prev_layer_size = layer_sizes[i]
  
      self.task_W_list = []
      self.task_b_list = []
      for i in range(self.n_tasks):
          W_init = np.random.normal(
              0, weight_init_stddevs[-1], (prev_layer_size, 1)
          )
          W_init = torch.cuda.FloatTensor(W_init)
          self.task_W_list.append(
              torch.autograd.Variable(W_init, requires_grad=True)
          )
          b_init = np.full((1,), bias_init_consts[-1])
          b_init = torch.cuda.FloatTensor(b_init)
          self.task_b_list.append(
              torch.autograd.Variable(b_init, requires_grad=True)
          )
      self.trainables = (
          self.W_list
          + self.b_list
          + self.task_W_list
          + self.task_b_list
      )
      self.regularizaed_variables = self.W_list + self.task_W_list
  
file_path: deepchem/contrib/torch/torch_multitask_regression.py
imports: import torch
  import numpy
  from torch_model import TorchMultitaskModel
label_desc: Use image node_id 2 for calling the TorchMultitaskRegression obj's underlying member method code with example usage: obj.build() without return types