def target_subnet(model, subnet_idx):
    """
    model = Keras model
    subnet_idx = indexes of the subnet you want to target.
        ex: subnet_idx = [1,0] -> targets model.layers[1].layers[0]
    """
    subnet = model
    for idx in subnet_idx:
        subnet = subnet.layers[idx]
    return subnet