I have a dataset like the one in the picture below, with m rows (= batch size) and n columns (v1, v2, ... vn), each representing a feature. For each example in the dataset, each feature is a string representation of an array of floats, so something like this '[-0.05, 1.12, -0.23, ..., 1.22]'. The "hidden" array represented as a string, if converted to an array of floats, has length k. This input is fed directly into a Tensorflow/Keras model without any Python preprocessing: the dataset is passed as is to model.fit, so there is no way to do conversions and reshaping in Pandas or Numpy.
Is there a way to convert and reshape inside the model, as the first layer? The model takes the input with shape (m, n), extract the hidden array of length k and rearrange the input shape to (m, k, n)
