Get intermediate feature of a model

Hello !
I’m curently doing some test on a Model that is supposed to classify cloud point. My inputs are 2500 3D points, but the first part of my network only focus on points as an individuals, without looking at them globally.
Here is the description of my model :

Model: "point_model"
__________________________________________________________________________________________________
 Layer (type)                   Output Shape         Param #     Connected to                     
==================================================================================================
 input_61 (InputLayer)          [(None, 2500, 3)]    0           []                               
                                                                                                  
 dense_251 (Dense)              (None, 2500, 128)    512         ['input_61[0][0]']               
                                                                                                  
 batch_normalization_184 (Batch  (None, 2500, 128)   512         ['dense_251[0][0]']              
 Normalization)                                                                                   
                                                                                                  
 activation_162 (Activation)    (None, 2500, 128)    0           ['batch_normalization_184[0][0]']
                                                                                                  
 dense_252 (Dense)              (None, 2500, 256)    33024       ['activation_162[0][0]']         
                                                                                                  
 batch_normalization_185 (Batch  (None, 2500, 256)   1024        ['dense_252[0][0]']              
 Normalization)                                                                                   
                                                                                                  
 activation_163 (Activation)    (None, 2500, 256)    0           ['batch_normalization_185[0][0]']
                                                                                                  
 dense_253 (Dense)              (None, 2500, 6)      1542        ['activation_163[0][0]']         
                                                                                                  
 batch_normalization_186 (Batch  (None, 2500, 6)     24          ['dense_253[0][0]']              
 Normalization)                                                                                   
                                                                                                  
 activation_164 (Activation)    (None, 2500, 6)      0           ['batch_normalization_186[0][0]']
                                                                                                  
 flatten_7 (Flatten)            (None, 15000)        0           ['activation_164[0][0]']         
                                                                                                  
 dense_254 (Dense)              (None, 6)            90006       ['flatten_7[0][0]']              
                                                                                                  
 input_9 (InputLayer)           [(None, 1)]          0           []                               
                                                                                                  
 concatenate_2 (Concatenate)    (None, 7)            0           ['dense_254[0][0]',              
                                                                  'input_9[0][0]']                
                                                                                                  
 dense_255 (Dense)              (None, 10)           80          ['concatenate_2[0][0]']          
                                                                                                  
==================================================================================================

Until the activation 164 layers, all points are treated separately, and layers only operate on the last dimensions.

For the sake of understandability, I’d like to be able to visualize what are the intermediate feature associated to each point. I’ve found online these commands, that should have helped me :

inputs = point_model.input
outputs = point_model.get_layer('activation_164').output
functor = K.function([inputs], [outputs])

Problem is that my model has an input shape of (2500,3), and I’d only want to put as inputs some points of shape 3, since first part of the model only do operations on that last dimension.
I know that I could create some bash of points of size (2500, 3), and then get the result as a first line of my result (if the first point of the batch is what I want to evaluate), but I was wondering if they were some more elegant / adapted ways to do this using keras functions.

More generally, I was wondering it was possible in keras to subdivise model in lower model. In this case, could have I developped a model that only treats a point of shape (3), and then apply it consecutively to all my points in my list of 2500 points ?

Thanks a lot if you have time to answer me, have a nice day !

Hi @anon3811548

Welcome to the TensorFlow Forum!

Please provide the clear description of the issue. What is the dataset type and what is your objective to achieve by model training? Could you please share minimal reproducible code to replicate the code and understand the issue? Thank you.