class_docstr: Simple Conv-1D classifier.
  This is a combination of the
  :class:`~texar.tf.modules.Conv1DEncoder` with a classification layer.
  
  Args:
      hparams (dict, optional): Hyperparameters. Missing
          hyperparamerter will be set to default values. See
          :meth:`default_hparams` for the hyperparameter sturcture and
          default values.
  
  Example:
  
      .. code-block:: python
  
          clas = Conv1DClassifier(hparams={'num_classes': 10})
  
          inputs = tf.random_uniform([64, 20, 256])
          logits, pred = clas(inputs)
          # logits == Tensor of shape [64, 10]
          # pred   == Tensor of shape [64]
  
  .. document private functions
  .. automethod:: _build
class_docstr_tok: ["Simple","Conv-1D","classifier",".","This","is","a","combination","of","the",":","class",":","`","~texar.tf.modules.Conv1DEncoder","`","with","a","classification","layer",".","Args",":","hparams","(","dict",",","optional",")",":","Hyperparameters",".","Missing","hyperparamerter","will","be","set","to","default","values",".","See",":","meth",":","`","default_hparams","`","for","the","hyperparameter","sturcture","and","default","values",".","Example",":","..","code-block",":",":","python","clas","=","Conv1DClassifier","(","hparams=","{","'num_classes","'",":","10","}",")","inputs","=","tf.random_uniform","(","[","64",",","20",",","256","]",")","logits",",","pred","=","clas","(","inputs",")","#","logits","==","Tensor","of","shape","[","64",",","10","]","#","pred","==","Tensor","of","shape","[","64","]","..","document","private","functions","..","automethod",":",":","_build"]
code: def __init__(self, hparams=None):
      ClassifierBase.__init__(self, hparams)
  
      with tf.variable_scope(self.variable_scope):
          encoder_hparams = utils.dict_fetch(
              hparams, Conv1DEncoder.default_hparams()
          )
          self._encoder = Conv1DEncoder(hparams=encoder_hparams)
  
          # Add an additional dense layer if needed
          self._num_classes = self._hparams.num_classes
          if self._num_classes > 0:
              if self._hparams.num_dense_layers <= 0:
                  self._encoder.append_layer({"type": "Flatten"})
  
              logit_kwargs = self._hparams.logit_layer_kwargs
              if logit_kwargs is None:
                  logit_kwargs = {}
              elif not isinstance(logit_kwargs, HParams):
                  raise ValueError(
                      "hparams['logit_layer_kwargs'] must be a dict."
                  )
              else:
                  logit_kwargs = logit_kwargs.todict()
              logit_kwargs.update({"units": self._num_classes})
              if "name" not in logit_kwargs:
                  logit_kwargs["name"] = "logit_layer"
  
              self._encoder.append_layer(
                  {"type": "Dense", "kwargs": logit_kwargs}
              )
  
imports: import tensorflow
  from texar.tf.utils.exceptions import TexarError
  from texar.tf.modules.classifiers.classifier_base import ClassifierBase
  from texar.tf.modules.encoders.conv_encoders import Conv1DEncoder
  from texar.tf.utils import utils
  from texar.tf.hyperparams import HParams
label_desc: Use image node_id 1 to create a new Conv1DClassifier object from inherited base classes: ClassifierBase with example: obj = Conv1DClassifier(hparams)