class_docstr: Time series attentional prototype network (TapNet), as described in [1].
  
   TapNet was initially proposed for multivariate time series
   classification. The is an adaptation for time series regression. TapNet comprises
   these components: random dimension permutation, multivariate time series
   encoding, and attentional prototype learning.
  
  Parameters
  ----------
  filter_sizes        : array of int, default = (256, 256, 128)
      sets the kernel size argument for each convolutional block.
      Controls number of convolutional filters
      and number of neurons in attention dense layers.
  kernel_size        : array of int, default = (8, 5, 3)
      controls the size of the convolutional kernels
  layers              : array of int, default = (500, 300)
      size of dense layers
  n_epochs            : int, default = 2000
      number of epochs to train the model
  batch_size          : int, default = 16
      number of samples per update
  dropout             : float, default = 0.5
      dropout rate, in the range [0, 1)
  dilation            : int, default = 1
      dilation value
  activation          : str, default = "sigmoid"
      activation function for the last output layer
  loss                : str, default = "mean_squared_error"
      loss function for the classifier
  optimizer           : str or None, default = "Adam(lr=0.01)"
      gradient updating function for the classifier
  use_bias            : bool, default = True
      whether to use bias in the output dense layer
  use_rp              : bool, default = True
      whether to use random projections
  use_att             : bool, default = True
      whether to use self attention
  use_lstm        : bool, default = True
      whether to use an LSTM layer
  use_cnn         : bool, default = True
      whether to use a CNN layer
  verbose         : bool, default = False
      whether to output extra information
  random_state    : int or None, default = None
      seed for random
  
  References
  ----------
  .. [1] Zhang et al. Tapnet: Multivariate time series classification with
  attentional prototypical network,
  Proceedings of the AAAI Conference on Artificial Intelligence
  34(4), 6845-6852, 2020
  
  Notes
  -----
  The Implementation of TapNet found at https://github.com/kdd2019-tapnet/tapnet
  Currently does not implement custom distance matrix loss function
  or class  based self attention.
class_docstr_tok: ["Time","series","attentional","prototype","network","(","TapNet",")",",","as","described","in","[","1","]",".","TapNet","was","initially","proposed","for","multivariate","time","series","classification",".","The","is","an","adaptation","for","time","series","regression",".","TapNet","comprises","these","components",":","random","dimension","permutation",",","multivariate","time","series","encoding",",","and","attentional","prototype","learning",".","Parameters","--","--","--","--","--","filter_sizes",":","array","of","int",",","default","=","(","256",",","256",",","128",")","sets","the","kernel","size","argument","for","each","convolutional","block",".","Controls","number","of","convolutional","filters","and","number","of","neurons","in","attention","dense","layers",".","kernel_size",":","array","of","int",",","default","=","(","8",",","5",",","3",")","controls","the","size","of","the","convolutional","kernels","layers",":","array","of","int",",","default","=","(","500",",","300",")","size","of","dense","layers","n_epochs",":","int",",","default","=","2000","number","of","epochs","to","train","the","model","batch_size",":","int",",","default","=","16","number","of","samples","per","update","dropout",":","float",",","default","=","0.5","dropout","rate",",","in","the","range","[","0",",","1",")","dilation",":","int",",","default","=","1","dilation","value","activation",":","str",",","default","=","``","sigmoid","''","activation","function","for","the","last","output","layer","loss",":","str",",","default","=","``","mean_squared_error","''","loss","function","for","the","classifier","optimizer",":","str","or","None",",","default","=","``","Adam","(","lr=0.01",")","''","gradient","updating","function","for","the","classifier","use_bias",":","bool",",","default","=","True","whether","to","use","bias","in","the","output","dense","layer","use_rp",":","bool",",","default","=","True","whether","to","use","random","projections","use_att",":","bool",",","default","=","True","whether","to","use","self","attention","use_lstm",":","bool",",","default","=","True","whether","to","use","an","LSTM","layer","use_cnn",":","bool",",","default","=","True","whether","to","use","a","CNN","layer","verbose",":","bool",",","default","=","False","whether","to","output","extra","information","random_state",":","int","or","None",",","default","=","None","seed","for","random","References","--","--","--","--","--","..","[","1","]","Zhang","et","al",".","Tapnet",":","Multivariate","time","series","classification","with","attentional","prototypical","network",",","Proceedings","of","the","AAAI","Conference","on","Artificial","Intelligence","34","(","4",")",",","6845-6852",",","2020","Notes","--","--","-","The","Implementation","of","TapNet","found","at","https",":","\/\/github.com\/kdd2019-tapnet\/tapnet","Currently","does","not","implement","custom","distance","matrix","loss","function","or","class","based","self","attention","."]
docstr: Construct a complied, un-trained, keras model that is ready for training.
  
  In sktime, time series are stored in numpy arrays of shape (d,m), where d
  is the number of dimensions, m is the series length. Keras/tensorflow assume
  data is in shape (m,d). This method also assumes (m,d). Transpose should
  happen in fit.
  
  Parameters
  ----------
  input_shape     : tuple
      The shape of the data fed into the input layer, should be (m, d)
  
  Returns
  -------
  output: a compiled Keras model
docstr_tok: ["Construct","a","complied",",","un-trained",",","keras","model","that","is","ready","for","training",".","In","sktime",",","time","series","are","stored","in","numpy","arrays","of","shape","(","d",",","m",")",",","where","d","is","the","number","of","dimensions",",","m","is","the","series","length",".","Keras\/tensorflow","assume","data","is","in","shape","(","m",",","d",")",".","This","method","also","assumes","(","m",",","d",")",".","Transpose","should","happen","in","fit",".","Parameters","--","--","--","--","--","input_shape",":","tuple","The","shape","of","the","data","fed","into","the","input","layer",",","should","be","(","m",",","d",")","Returns","--","--","--","-","output",":","a","compiled","Keras","model"]
code: def build_model(self, input_shape, **kwargs):
      """Construct a complied, un-trained, keras model that is ready for training.
  
      In sktime, time series are stored in numpy arrays of shape (d,m), where d
      is the number of dimensions, m is the series length. Keras/tensorflow assume
      data is in shape (m,d). This method also assumes (m,d). Transpose should
      happen in fit.
  
      Parameters
      ----------
      input_shape     : tuple
          The shape of the data fed into the input layer, should be (m, d)
  
      Returns
      -------
      output: a compiled Keras model
      """
      import tensorflow as tf
      from tensorflow import keras
  
      tf.random.set_seed(self.random_state)
  
      metrics = (
          ["mean_squared_error"]
          if self.metrics is None
          else self.metrics
      )
  
      input_layer, output_layer = self._network.build_network(
          input_shape, **kwargs
      )
  
      output_layer = keras.layers.Dense(
          units=1, activation=self.activation, use_bias=self.use_bias
      )(output_layer)
  
      self.optimizer_ = (
          keras.optimizers.Adam(learning_rate=0.01)
          if self.optimizer is None
          else self.optimizer
      )
  
      model = keras.models.Model(
          inputs=input_layer, outputs=output_layer
      )
      model.compile(
          loss=self.loss,
          optimizer=self.optimizer_,
          metrics=metrics,
      )
  
      return model
  
file_path: sktime/sktime/regression/deep_learning/tapnet.py
imports: from copy import deepcopy
  from sklearn.utils import check_random_state
  from sktime.networks.tapnet import TapNetNetwork
  from sktime.regression.deep_learning.base import BaseDeepRegressor
  from sktime.utils.validation._dependencies import _check_dl_dependencies
label_desc: Use image node_id 2 for calling the TapNetRegressor obj's underlying member method code with example usage: obj.build_model(input_shape) and returns: model