class_docstr: Base class for models
class_docstr_tok: ["Base","class","for","models"]
docstr: Transform the input value with an activation. May use dropout.
  
  Args:
      logit (object): Input value.
      activation (str): A string indicating the type of activation function.
      layer_idx (int): Index of current layer. Used to retrieve corresponding parameters
  
  Returns:
      object: A tensor after applying activation function on logit.
docstr_tok: ["Transform","the","input","value","with","an","activation",".","May","use","dropout",".","Args",":","logit","(","object",")",":","Input","value",".","activation","(","str",")",":","A","string","indicating","the","type","of","activation","function",".","layer_idx","(","int",")",":","Index","of","current","layer",".","Used","to","retrieve","corresponding","parameters","Returns",":","object",":","A","tensor","after","applying","activation","function","on","logit","."]
code: def _active_layer(self, logit, activation, layer_idx=-1):
      """Transform the input value with an activation. May use dropout.
  
      Args:
          logit (object): Input value.
          activation (str): A string indicating the type of activation function.
          layer_idx (int): Index of current layer. Used to retrieve corresponding parameters
  
      Returns:
          object: A tensor after applying activation function on logit.
      """
      if layer_idx >= 0 and self.hparams.user_dropout:
          logit = self._dropout(logit, self.layer_keeps[layer_idx])
      return self._activate(logit, activation)
  
imports: from os.path import join
  import abc
  import time
  import os
  import numpy
  import tensorflow
  from recommenders.models.deeprec.deeprec_utils import cal_metric
label_desc: Use image node_id 14 for calling the BaseModel obj's underlying member method code with example usage: obj._active_layer(logit, activation, layer_idx) and returns: self