class_docstr: Addes a frequency information channel to spectrograms.
  
  The added frequency channel (=frequency map) has a linearly increasing values from 0.0 to 1.0,
  indicating the normalize frequency of a time-frequency bin. This layer can be applied to input audio spectrograms
  or any feature maps so that the following layers can be conditioned on the frequency. (Imagine something like
  positional encoding in NLP but the position is on frequency axis).
  
  A combination of `ConcatenateFrequencyMap` and `Conv2D` is known as frequency-aware convolution (see References).
  For your convenience, such a layer is supported by `karep.composed.get_frequency_aware_conv2d()`.
  
  Args:
      data_format (str): specifies the data format of batch input/output.
      **kwargs: Keyword args for the parent keras layer (e.g., `name`)
  
  Example:
      ::
  
          input_shape = (2048, 1)  # mono signal
          model = Sequential()
          model.add(kapre.STFT(n_fft=1024, hop_length=512, input_shape=input_shape))
          model.add(kapre.Magnitude())
          # (batch, n_frame=3, n_freq=513, ch=1) and dtype is float
          model.add(kapre.ConcatenateFrequencyMap())
          # (batch, n_frame=3, n_freq=513, ch=2)
          # now add your model
          mode.add(keras.layers.Conv2D(16, (3, 3), strides=(2, 2), activation='relu')
          # you can concatenate frequency map before other conv layers,
          # but probably, you wouldn't want to add it right before batch normalization.
          model.add(kapre.ConcatenateFrequencyMap())
          model.add(keras.layers.Conv2D(32, (3, 3), strides=(1, 1), activation='relu')
          model.add(keras.layers.MaxPooling2D((2, 2)))  # length of frequency axis doesn't matter
  
  References:
      Koutini, K., Eghbal-zadeh, H., & Widmer, G. (2019).
      `Receptive-Field-Regularized CNN Variants for Acoustic Scene Classification <https://arxiv.org/abs/1909.02859>`_.
      In Proceedings of the Detection and Classification of Acoustic Scenes and Events 2019 Workshop (DCASE2019).
class_docstr_tok: ["Addes","a","frequency","information","channel","to","spectrograms",".","The","added","frequency","channel","(","=frequency","map",")","has","a","linearly","increasing","values","from","0.0","to","1.0",",","indicating","the","normalize","frequency","of","a","time-frequency","bin",".","This","layer","can","be","applied","to","input","audio","spectrograms","or","any","feature","maps","so","that","the","following","layers","can","be","conditioned","on","the","frequency",".","(","Imagine","something","like","positional","encoding","in","NLP","but","the","position","is","on","frequency","axis",")",".","A","combination","of","`","ConcatenateFrequencyMap","`","and","`","Conv2D","`","is","known","as","frequency-aware","convolution","(","see","References",")",".","For","your","convenience",",","such","a","layer","is","supported","by","`","karep.composed.get_frequency_aware_conv2d","(",")","`",".","Args",":","data_format","(","str",")",":","specifies","the","data","format","of","batch","input\/output",".","*","*","kwargs",":","Keyword","args","for","the","parent","keras","layer","(","e.g.",",","`","name","`",")","Example",":",":",":","input_shape","=","(","2048",",","1",")","#","mono","signal","model","=","Sequential","(",")","model.add","(","kapre.STFT","(","n_fft=1024",",","hop_length=512",",","input_shape=input_shape",")",")","model.add","(","kapre.Magnitude","(",")",")","#","(","batch",",","n_frame=3",",","n_freq=513",",","ch=1",")","and","dtype","is","float","model.add","(","kapre.ConcatenateFrequencyMap","(",")",")","#","(","batch",",","n_frame=3",",","n_freq=513",",","ch=2",")","#","now","add","your","model","mode.add","(","keras.layers.Conv2D","(","16",",","(","3",",","3",")",",","strides=","(","2",",","2",")",",","activation='relu","'",")","#","you","can","concatenate","frequency","map","before","other","conv","layers",",","#","but","probably",",","you","would","n't","want","to","add","it","right","before","batch","normalization",".","model.add","(","kapre.ConcatenateFrequencyMap","(",")",")","model.add","(","keras.layers.Conv2D","(","32",",","(","3",",","3",")",",","strides=","(","1",",","1",")",",","activation='relu","'",")","model.add","(","keras.layers.MaxPooling2D","(","(","2",",","2",")",")",")","#","length","of","frequency","axis","does","n't","matter","References",":","Koutini",",","K.",",","Eghbal-zadeh",",","H.",",","&","Widmer",",","G.","(","2019",")",".","`","Receptive-Field-Regularized","CNN","Variants","for","Acoustic","Scene","Classification","<","https",":","\/\/arxiv.org\/abs\/1909.02859",">","`","_",".","In","Proceedings","of","the","Detection","and","Classification","of","Acoustic","Scenes","and","Events","2019","Workshop","(","DCASE2019",")","."]
code: def _concat_frequency_map(self, inputs):
      shape = tf.shape(inputs)
      time_axis, freq_axis, ch_axis = (
          (1, 2, 3) if self.data_format == _CH_LAST_STR else (2, 3, 1)
      )
      batch_size, n_freq, n_time, n_ch = (
          shape[0],
          shape[freq_axis],
          shape[time_axis],
          shape[ch_axis],
      )
  
      # freq_info shape: n_freq
      freq_map_1d = tf.cast(
          tf.linspace(start=0.0, stop=1.0, num=n_freq), dtype=tf.float32
      )
  
      new_shape = (
          (1, 1, -1, 1)
          if self.data_format == _CH_LAST_STR
          else (1, 1, 1, -1)
      )
      freq_map_1d = tf.reshape(freq_map_1d, new_shape)  # 4D now
  
      multiples = (
          (batch_size, n_time, 1, 1)
          if self.data_format == _CH_LAST_STR
          else (batch_size, 1, n_time, 1)
      )
      freq_map_4d = tf.tile(freq_map_1d, multiples)
  
      return tf.concat([inputs, freq_map_4d], axis=ch_axis)
  
imports: import tensorflow
  from tensorflow.keras import backend
  from tensorflow.keras.layers import Layer
  from .None import backend
  from .backend import _CH_FIRST_STR, _CH_LAST_STR, _CH_DEFAULT_STR
  from .tflite_compatible_stft import atan2_tflite
label_desc: Use image node_id 3 for calling the ConcatenateFrequencyMap obj's underlying member method code with example usage: obj._concat_frequency_map(inputs) and returns: tf