MCPcopy
hub / github.com/Farama-Foundation/Metaworld / move

Function move

metaworld/policies/policy.py:33–53  ·  view source on GitHub ↗

Computes action components that help move from 1 position to another. Args: from_xyz: The coordinates to move from (usually current position) to_xyz: The coordinates to move to p: constant to scale response Returns: Response that will decrease abs(to_xyz - f

(
    from_xyz: npt.NDArray[Any], to_xyz: npt.NDArray[Any], p: float
)

Source from the content-addressed store, hash-verified

31
32
33def move(
34 from_xyz: npt.NDArray[Any], to_xyz: npt.NDArray[Any], p: float
35) -> npt.NDArray[Any]:
36 """Computes action components that help move from 1 position to another.
37
38 Args:
39 from_xyz: The coordinates to move from (usually current position)
40 to_xyz: The coordinates to move to
41 p: constant to scale response
42
43 Returns:
44 Response that will decrease abs(to_xyz - from_xyz)
45 """
46 error = to_xyz - from_xyz
47 response = p * error
48 if np.any(np.absolute(response) > 1.0):
49 warnings.warn(
50 "Constant(s) may be too high. Environments clip response to [-1, 1]"
51 )
52
53 return response
54
55
56class Policy(abc.ABC):

Callers 15

get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90
get_actionMethod · 0.90

Calls

no outgoing calls

Tested by 1

get_actionMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…