class_docstr: Implements Region Proposal Network (RPN).
  
  Arguments:
      anchor_generator (AnchorGenerator): module that generates the anchors for a set of feature
          maps.
      head (nn.Module): module that computes the objectness and regression deltas
      fg_iou_thresh (float): minimum IoU between the anchor and the GT box so that they can be
          considered as positive during training of the RPN.
      bg_iou_thresh (float): maximum IoU between the anchor and the GT box so that they can be
          considered as negative during training of the RPN.
      batch_size_per_image (int): number of anchors that are sampled during training of the RPN
          for computing the loss
      positive_fraction (float): proportion of positive anchors in a mini-batch during training
          of the RPN
      pre_nms_top_n (Dict[str]): number of proposals to keep before applying NMS. It should
          contain two fields: training and testing, to allow for different values depending
          on training or evaluation
      post_nms_top_n (Dict[str]): number of proposals to keep after applying NMS. It should
          contain two fields: training and testing, to allow for different values depending
          on training or evaluation
      nms_thresh (float): NMS threshold used for postprocessing the RPN proposals
class_docstr_tok: ["Implements","Region","Proposal","Network","(","RPN",")",".","Arguments",":","anchor_generator","(","AnchorGenerator",")",":","module","that","generates","the","anchors","for","a","set","of","feature","maps",".","head","(","nn.Module",")",":","module","that","computes","the","objectness","and","regression","deltas","fg_iou_thresh","(","float",")",":","minimum","IoU","between","the","anchor","and","the","GT","box","so","that","they","can","be","considered","as","positive","during","training","of","the","RPN",".","bg_iou_thresh","(","float",")",":","maximum","IoU","between","the","anchor","and","the","GT","box","so","that","they","can","be","considered","as","negative","during","training","of","the","RPN",".","batch_size_per_image","(","int",")",":","number","of","anchors","that","are","sampled","during","training","of","the","RPN","for","computing","the","loss","positive_fraction","(","float",")",":","proportion","of","positive","anchors","in","a","mini-batch","during","training","of","the","RPN","pre_nms_top_n","(","Dict","[","str","]",")",":","number","of","proposals","to","keep","before","applying","NMS",".","It","should","contain","two","fields",":","training","and","testing",",","to","allow","for","different","values","depending","on","training","or","evaluation","post_nms_top_n","(","Dict","[","str","]",")",":","number","of","proposals","to","keep","after","applying","NMS",".","It","should","contain","two","fields",":","training","and","testing",",","to","allow","for","different","values","depending","on","training","or","evaluation","nms_thresh","(","float",")",":","NMS","threshold","used","for","postprocessing","the","RPN","proposals"]
code: def post_nms_top_n(self):
      if self.training:
          return self._post_nms_top_n["training"]
      return self._post_nms_top_n["testing"]
  
imports: from typing import List, Optional, Dict, Tuple
  import torch
  from torch import nn, Tensor
  from torch.nn import functional
  import torchvision
  from .None import det_utils
  from .None import boxes
  from .image_list import ImageList
label_desc: Use image node_id 3 for calling the RegionProposalNetwork obj's underlying member method code with example usage: obj.post_nms_top_n() and returns: self, self