class_docstr: Implements a progressive multitask neural network for regression.
  
  Progressive networks allow for multitask learning where each task
  gets a new column of weights. As a result, there is no exponential
  forgetting where previous tasks are ignored.
  
  References
  ----------
  See [1]_ for a full description of the progressive architecture
  
  .. [1] Rusu, Andrei A., et al. "Progressive neural networks." arXiv preprint
      arXiv:1606.04671 (2016).
docstr: Add an adapter connection for given task/layer combo
docstr_tok: ["Add","an","adapter","connection","for","given","task\/layer","combo"]
code: def add_adapter(self, all_layers, task, layer_num):
      """Add an adapter connection for given task/layer combo"""
      i = layer_num
      prev_layers = []
      trainable_layers = []
      # Handle output layer
      if i < len(self.layer_sizes):
          layer_sizes = self.layer_sizes
          alpha_init_stddev = self.alpha_init_stddevs[i]
          weight_init_stddev = self.weight_init_stddevs[i]
          bias_init_const = self.bias_init_consts[i]
      elif i == len(self.layer_sizes):
          layer_sizes = self.layer_sizes + [self.n_outputs]
          alpha_init_stddev = self.alpha_init_stddevs[-1]
          weight_init_stddev = self.weight_init_stddevs[-1]
          bias_init_const = self.bias_init_consts[-1]
      else:
          raise ValueError("layer_num too large for add_adapter.")
      # Iterate over all previous tasks.
      for prev_task in range(task):
          prev_layers.append(all_layers[(i - 1, prev_task)])
      # prev_layers is a list with elements of size
      # (batch_size, layer_sizes[i-1])
      if len(prev_layers) == 1:
          prev_layer = prev_layers[0]
      else:
          prev_layer = Concatenate(axis=1)(prev_layers)
      alpha = layers.Variable(
          tf.random.truncated_normal((1,), stddev=alpha_init_stddev)
      )
      trainable_layers.append(alpha)
  
      prev_layer = Multiply()([prev_layer, alpha([prev_layer])])
      dense1 = Dense(
          layer_sizes[i - 1],
          kernel_initializer=tf.keras.initializers.TruncatedNormal(
              stddev=weight_init_stddev
          ),
          bias_initializer=tf.constant_initializer(
              value=bias_init_const
          ),
      )
      prev_layer = dense1(prev_layer)
      trainable_layers.append(dense1)
  
      dense2 = Dense(
          layer_sizes[i],
          kernel_initializer=tf.keras.initializers.TruncatedNormal(
              stddev=weight_init_stddev
          ),
          use_bias=False,
      )
      prev_layer = dense2(prev_layer)
      trainable_layers.append(dense2)
  
      return prev_layer, trainable_layers
  
imports: import numpy
  import tensorflow
  from collections.abc import Sequence
  import logging
  from deepchem.models import KerasModel, layers
  from deepchem.models.losses import L2Loss, SparseSoftmaxCrossEntropy
  from deepchem.models.keras_model import _StandardLoss
  from tensorflow.keras.layers import Input, Dense, Dropout, ReLU, Concatenate, Add, Multiply, Softmax
label_desc: Use image node_id 4 for calling the ProgressiveMultitaskRegressor obj's underlying member method code with example usage: obj.add_adapter(all_layers, task, layer_num) and returns: prev_layer,  trainable_layers