original_docstring: Map w from the real hypervolume to the unit hypersphere.
docstring: Map w from the real hypervolume to the unit hypersphere.
docstring_tokens: Map w from the real hypervolume to the unit hypersphere .
code: def _map_to_sphere(self, w):
          """Map w from the real hypervolume to the unit hypersphere."""
          # MAF passes the parameters in shape (batch_size, n_parameters, n_features).
          w = w[:, 0]
          # Tanh maps the real hypervolume to the unit hypercube.
          w = torch.tanh(w)
          # Finally we map the unit hypercube to the unit hypersphere.
          return unit_cube_to_inscribed_sphere(w, self.blocks, self.shorten_last_block)
code_tokens: def _map_to_sphere ( self , w ) : w = w [ : , 0 ] w = torch . tanh ( w ) return unit_cube_to_inscribed_sphere ( w , self . blocks , self . shorten_last_block )
short_docstring: Map w from the real hypervolume to the unit hypersphere.
short_docstring_tokens: Map w from the real hypervolume to the unit hypersphere .
comment: """Map w from the real hypervolume to the unit hypersphere."""$SEP$# MAF passes the parameters in shape (batch_size, n_parameters, n_features).$SEP$# Tanh maps the real hypervolume to the unit hypercube.$SEP$# Finally we map the unit hypercube to the unit hypersphere.