MCPcopy
hub / github.com/WassimTenachi/PhySO / coords_of_step

Method coords_of_step

physo/physym/vect_programs.py:710–726  ·  view source on GitHub ↗

Helper method returning the tuple of coordinates corresponding to a step. Parameters ---------- step : int Step. Returns ------- coords : numpy.array of shape (2, batch_size,) of int Coordinates, 0th array in batch dim

(self, step)

Source from the content-addressed store, hash-verified

708 return np.tile(batch_vect, (self.max_time_step, 1)).transpose() # (batch_size, max_time_step,) of ?
709
710 def coords_of_step (self, step):
711 """
712 Helper method returning the tuple of coordinates corresponding to a step.
713 Parameters
714 ----------
715 step : int
716 Step.
717 Returns
718 -------
719 coords : numpy.array of shape (2, batch_size,) of int
720 Coordinates, 0th array in batch dim and 1th array in time dim.
721 """
722 coords = np.stack(( # (2, batch_size,) of int
723 self.tokens.pos_batch [:, step], # batch dim coord
724 self.tokens.pos [:, step], # time dim coord
725 ), axis=0)
726 return coords
727
728 # -----------------------------------------------------------------------------------------------------------------
729 # -------------------------------------------- UTILS : TOKEN MANAGEMENT -------------------------------------------

Callers 13

__init__Method · 0.95
appendMethod · 0.95
assign_required_unitsMethod · 0.95
get_sibling_units_obsMethod · 0.80
get_parent_units_obsMethod · 0.80

Calls

no outgoing calls