code: def _get_start_layer_probs_for_branching_and_skipping(nn):
      """Returns probabilities for the start layer to be used in branching and
      skipping primitives.
      """
      dists_from_ip = nn.get_distances_from_ip()
      start_layer_prob = []
      for layer_idx, layer_label in enumerate(nn.layer_labels):
          # We pick the first layer with distance inversely proportional to its distance from ip
          curr_layer_prob = (
              0
              if layer_label in ["op", "softmax", "fc", "linear"]
              else 1.0 / np.sqrt(1 + dists_from_ip[layer_idx])
          )
          start_layer_prob.append(curr_layer_prob)
      start_layer_prob = np.array(start_layer_prob)
      return start_layer_prob
  
imports: from argparse import Namespace
  from copy import deepcopy
  import numpy
  from .neural_network import ConvNeuralNetwork, MultiLayerPerceptron, MLP_RECTIFIERS, MLP_SIGMOIDS, is_a_pooling_layer_label, is_a_conv_layer_label, CNNImageSizeMismatchException, CNNNoConvAfterIPException
  from ..utils.general_utils import reorder_list_or_array, reorder_rows_and_cols_in_matrix
  from ..utils.option_handler import get_option_specs, load_options
  from ..utils.reporters import get_reporter
label_desc: Use image node_id 12 for calling a global function with example usage: _get_start_layer_probs_for_branching_and_skipping(nn) and returns: start_layer_prob