In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how apollo adds a new evaluator to the prediction module. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Brief introduction
The evaluator uses a pre-trained deep learning model to generate features (raw information from obstacles and cars) to obtain model output.
To add an evaluator
Follow these steps to add an evaluator named NewEvaluator:
Add a file to proto
Define a new class NewEvaluator by inheriting the Evaluator class
Implement the NewEvaluator class
Update Forecast profile
Update Evaluation Manager
Define a new class that inherits Evaluator
Create the file new_evaluator.h under the modules/prediction/evaluator/vehicle folder
The contents of the document are as follows:
# include "modules/prediction/evaluator/evaluator.h" namespace apollo {namespace prediction {class NewEvaluator: public Evaluator {public:NewEvaluator (); virtual ~ NewEvaluator (); void Evaluate (Obstacle* obstacle_ptr) override;// Other useful functions and fields.};} / / namespace prediction} / / namespace apollo implements the newly defined class NewEvaluator
Create a file called new_evaluator.cc in the same folder to implement the newly defined class. The implementation of the new class is as follows:
# include "modules/prediction/evaluator/vehicle/new_evaluator.h" namespace apollo {namespace prediction {NewEvaluator::NewEvaluator () {/ / Implement} NewEvaluator::~NewEvaluator () {/ / Implement} NewEvaluator::Evaluate (Obstacle* obstacle_ptr) () {/ / Extract features// Compute new_output by applying pre-trained model} / / Other functions} / / namespace prediction} / / namespace apollo adds an evaluator to proto
Add a type to the file prediction_conf.proto to represent the new evaluator, as follows:
Enum EvaluatorType {MLP_EVALUATOR = 0 * forecasting EVALUATOR = 1;} Update Forecast profile
In the configuration file modules/prediction/conf/prediction_conf.pb.txt, update the evaluator_ field, as shown below:
Obstacle_conf {obstacle_type: VEHICLEobstacle_status: ON_LANEevaluator_type: NEW_EVALUATORpredictor_type: NEW_PREDICTOR} Update Evaluation Configurator
Update the function CreateEvluator (...) as shown in the following code example:
Case ObstacleConf::NEW_EVALUATOR: {evaluator_ptr.reset (new NewEvaluator ()); break;}
Update the function RegisterEvaluators () as shown in the following code example:
RegisterEvaluator (ObstacleConf::NEW_EVALUATOR)
After completing the above steps, a new evaluator has been created.
Add new attributes
If you want to add new attributes, please refer to the following instructions:
Add a new field to the proto file
Assume that the new evaluation output is new_output and its type is int32.
If the output is directly related to the obstacle, refer to the following code to add a new field to the modules/prediction/proto/feature.proto file:
Message Feature {/ / Other existing featuresoptional int32 new_output = 1000;}
If the output is related to the lane sequence, refer to the following code to add a new field to the modules/prediction/proto/lane_graph.proto file:
Message LaneSequence {/ / Other existing featuresoptional int32 new_output = 1000;} this is the end of the article on "how to add a new evaluator to the prediction module". I hope the above content can be helpful to you so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.