How to visualize learned features in DLC?

Hi, I’ve been looking at way to visualize the features that a CNN learns, and there is a technique for generating an image that maximizes a layer or feature activation, starting from a noise image. How can this be done with DLC? If I understand correctly, each bodypart can be associated with a layer on top of the ResNet in a DLC model. Can these layers be accesses? Any pointers appreciated.

So far, I’ve managed to find the code for loading weights and generating a ‘pose net’.

TF.reset_default_graph()
inputs = TF.placeholder(tf.float32, shape=[dlc_cfg["batch_size"], None, None, 3])

net_heads = pose_net(dlc_cfg).test(inputs)

outputs = [net_heads['part_prob']]
if dlc_cfg.location_refinement:
    outputs.append(net_heads['locref'])

restorer = TF.train.Saver()
sess = TF.Session()
sess.run(TF.global_variables_initializer())
sess.run(TF.local_variables_initializer())

restorer.restore(sess, dlc_cfg.init_weights)

I can load a trained network and supply it with an image, and it gives me back the pose, the scoremap, etc.

I should probably get better acquainted with tensorflow, looks quite complicated, though. I think from here, there should be a way of extracting the trained layers for each bodypart, right?