The SampleMovieLens class implements the MovieLens sample.
More...
|
void | constructNetwork (SampleUniquePtr< nvinfer1::IBuilder > &builder, SampleUniquePtr< nvinfer1::INetworkDefinition > &network, SampleUniquePtr< nvinfer1::IBuilderConfig > &config, SampleUniquePtr< nvuffparser::IUffParser > &parser) |
| Parses a Uff model for a MLP NCF model, creates a TensorRT network, and builds a TensorRT engine. More...
|
|
bool | processInput (const samplesCommon::BufferManager &buffers) |
| Copies a batch of input data from SampleMovieLensParams into managed input buffers. More...
|
|
std::string | readNextLine (std::ifstream &file, char delim) |
| Helper function to read the next line of the MovieLens dataset .csv file and return the contents of the line after the delimeter. More...
|
|
void | readInputSample (std::ifstream &file, OutputParams &outParams, std::string line) |
| Extracts needed dataset values for a single user in the MovieLens, dataset .csv file, and populates the corresponding ground truth data struct. More...
|
|
void | parseMovieLensData () |
| Parses the MovieLens dataset and populates the SampleMovieLensParams data structure. More...
|
|
void | printOutputParams (OutputParams &outParams) |
| Prints the expected recommendation results (ground truth) from the MovieLens dataset for a given user. More...
|
|
bool | verifyOutput (uint32_t *userInputPtr, uint32_t *, uint32_t *topKItemNumberPtr, float *topKItemProbPtr) |
| Verifies the inference output with ground truth and logs the results. More...
|
|
The SampleMovieLens class implements the MovieLens sample.
It creates the network using a uff model
◆ SampleUniquePtr
◆ SampleMovieLens()
◆ build()
bool SampleMovieLens::build |
( |
| ) |
|
Builds the network engine.
Creates the network, configures the builder and creates the network engine.
This function creates the MLP NCF network by parsing the Uff model and builds the engine that will be used to generate recommendations (mEngine)
- Returns
- Returns true if the engine was created successfully and false otherwise
◆ infer()
bool SampleMovieLens::infer |
( |
| ) |
|
Runs the TensorRT inference engine for this sample.
This function is the main execution function of the sample. It allocates the buffer, sets inputs, executes the engine, and verifies the output.
◆ teardown()
bool SampleMovieLens::teardown |
( |
| ) |
|
Used to clean up any state created in the sample class.
◆ constructNetwork()
Parses a Uff model for a MLP NCF model, creates a TensorRT network, and builds a TensorRT engine.
◆ processInput()
◆ readNextLine()
std::string SampleMovieLens::readNextLine |
( |
std::ifstream & |
file, |
|
|
char |
delim |
|
) |
| |
|
private |
Helper function to read the next line of the MovieLens dataset .csv file and return the contents of the line after the delimeter.
This function is called from SampleMovieLens::readInputSample() to extract the needed values per user.
◆ readInputSample()
void SampleMovieLens::readInputSample |
( |
std::ifstream & |
file, |
|
|
OutputParams & |
outParams, |
|
|
std::string |
line |
|
) |
| |
|
private |
Extracts needed dataset values for a single user in the MovieLens, dataset .csv file, and populates the corresponding ground truth data struct.
◆ parseMovieLensData()
void SampleMovieLens::parseMovieLensData |
( |
| ) |
|
|
private |
◆ printOutputParams()
void SampleMovieLens::printOutputParams |
( |
OutputParams & |
outParams | ) |
|
|
private |
Prints the expected recommendation results (ground truth) from the MovieLens dataset for a given user.
◆ verifyOutput()
bool SampleMovieLens::verifyOutput |
( |
uint32_t * |
userInputPtr, |
|
|
uint32_t * |
, |
|
|
uint32_t * |
topKItemNumberPtr, |
|
|
float * |
topKItemProbPtr |
|
) |
| |
|
private |
Verifies the inference output with ground truth and logs the results.
Compares the inference output with ground truth and logs the results.
◆ mParams
◆ mEngine
The TensorRT engine used to run the network.
The documentation for this class was generated from the following file: