class_docstr: We use random rays from a SINGLE time stamp per batch.
class_docstr_tok: ["We","use","random","rays","from","a","SINGLE","time","stamp","per","batch","."]
code: def get_num_rays_dict(self, num):
      num_body_rays = int(round(num * self.opt.body_rays_ratio))
      num_border_rays = (
          int(round(num * self.opt.border_rays_ratio))
          if self.opt.dilation > 0
          else 0
      )
      num_bkg_rays = int(round(num * self.opt.bkg_rays_ratio))
      leftover = num - num_body_rays - num_border_rays - num_bkg_rays
      arr = np.array([num_body_rays, num_border_rays, num_bkg_rays])
      arr[arr.argmax()] += leftover
      num_body_rays, num_border_rays, num_bkg_rays = arr
      assert (
          min(num_body_rays, num_border_rays, num_bkg_rays) >= 0
      ), f"{min(num_body_rays, num_border_rays, num_bkg_rays)}"
      assert sum(arr) == num, f"{arr}, {leftover}"
      return {
          "num_body_rays": num_body_rays,
          "num_border_rays": num_border_rays,
          "num_bkg_rays": num_bkg_rays,
      }
  
file_path: ml-neuman/datasets/human_rays.py
imports: import os
  import random
  import numpy
  import torch
  from torch.utils import data
  from data_io import cache_helper
  from utils import ray_utils
  from utils.constant import PATCH_SIZE, PATCH_SIZE_SQUARED, NEAR_INDEX, FAR_INDEX, TRAIN_SET_LENGTH, VALIDATION_SET_LENGTH
  from data_io import neuman_helper
label_desc: Use image node_id 3 for calling the HumanRayDataset obj's underlying member method code with example usage: obj.get_num_rays_dict(num) and returns: dict