Skip to content

Conversation

@aaravpandya
Copy link
Collaborator

No description provided.

@aaravpandya aaravpandya marked this pull request as ready for review April 23, 2025 02:40
Copy link
Contributor

@daphne-cornelisse daphne-cornelisse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, a couple of questions:

  • What is the function of the original steps_remaining tensor and the added episode length tensor?
  • Can you briefly explain the logic behind your current implementation?

Left several comments in the code, too.

Note that changing names such as episodeLen also requires changes in the Python side before merging. Happy to help with this part down the line

m.attr("kMaxRoadEntityCount") = consts::kMaxRoadEntityCount;
m.attr("kMaxAgentMapObservationsCount") = consts::kMaxAgentMapObservationsCount;
m.attr("episodeLen") = consts::episodeLen;
m.attr("maxEpisodeLen") = consts::maxEpisodeLength;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we stick to the original naming of episodeLen? The fact that an agent can be terminated before the episodeLen seems implied

.def("map_name_tensor", &Manager::mapNameTensor)
.def("scenario_id_tensor", &Manager::scenarioIdTensor);
.def("scenario_id_tensor", &Manager::scenarioIdTensor)
.def("episode_length_tensor", &Manager::episodeLengthTensor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have the steps remaining tensor, is the only diff that this one is counting up?


// Steps per episode
inline constexpr int32_t episodeLen = 91;
inline constexpr int32_t maxEpisodeLength = 200;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should stick to episodeLen

Also, let's keep the default value

inline constexpr float xDimensionScaleRoadSegment = 1;

inline constexpr madrona::CountT kTrajectoryLength = 91; // Nocturne has 90 timesteps per episode. making it 91 as a buffer.
// inline constexpr madrona::CountT kTrajectoryLength = 91; // Nocturne has 90 timesteps per episode. making it 91 as a buffer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if we support variable episode lengths, the log replay trajectories in the scenes will remain of shape 91.

Why is this deleted? There is an important difference between the length of the episode and the length of the data in the simulator

bool disableClassicalObs = false;
DynamicsModel dynamicsModel = DynamicsModel::Classic;
bool readFromTracksToPredict = false; // Default: false - for womd_tracks_to_predict initialization mode
uint32_t episode_length = 91;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeming inconsistency here: episode_length = 91 here and max episode length is 200?

for (const auto &v : j.at("valid"))
{
if (i < MAX_POSITIONS)
if (i < MAX_POSITIONS && i < numPositions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this block of code do?

};

const size_t TrajectoryExportSize = 2 * 2 * consts::kTrajectoryLength + 2 * consts::kTrajectoryLength + ActionExportSize * consts::kTrajectoryLength;
const size_t TrajectoryExportSize = 2 * 2 * consts::maxEpisodeLength + 2 * consts::maxEpisodeLength + ActionExportSize * consts::maxEpisodeLength;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks incorrect. Even if you increase the episode length, the data shape will always remain the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants