Execution settings for a Deep Learning tool. More...
#include <eVision/Easy/EasyDeepLearning/EDeepLearningExecutionSettings.h>
Public Member Functions | |
| EDeepLearningExecutionSettings () | |
| Constructs a EDeepLearningExecutionSettings. | |
| EDeepLearningExecutionSettings (const eVision::EasyDeepLearning::EDeepLearningExecutionSettings &other) | |
| Copy constructor. | |
| virtual | ~EDeepLearningExecutionSettings () throw () |
| eVision::EasyDeepLearning::EDeepLearningExecutionSettings & | operator= (const eVision::EasyDeepLearning::EDeepLearningExecutionSettings &other) |
| Assignment operator. | |
| bool | operator== (const eVision::EasyDeepLearning::EDeepLearningExecutionSettings &other) const |
| Comparison operator. | |
| bool | operator!= (const eVision::EasyDeepLearning::EDeepLearningExecutionSettings &other) const |
| Inequality operator. | |
| void | CopyTo (eVision::EasyDeepLearning::EDeepLearningExecutionSettings &other) const |
| Copy the object to another one. | |
| virtual void | Load (const std::string &filePath) |
| Loads the EDeepLearningExecutionSettings. The given ESerializer must have been created for reading. | |
| virtual void | Load (eVision::ESerializer *serializer) |
| Loads the EDeepLearningExecutionSettings. The given ESerializer must have been created for reading. | |
| virtual void | Save (const std::string &filePath) |
| Saves the EDeepLearningExecutionSettings. The given ESerializer must have been created for writing. | |
| virtual void | Save (eVision::ESerializer *serializer) |
| Saves the EDeepLearningExecutionSettings. The given ESerializer must have been created for writing. | |
| void | SetEngine (const std::string &engine) |
| Engine with which to execute or train the neural network. | |
| std::string | GetEngine () const |
| Engine with which to execute or train the neural network. | |
| eVision::EasyDeepLearning::EDeepLearningInferencePrecision | GetInferencePrecision () const |
| Inference precision. | |
| void | SetInferencePrecision (eVision::EasyDeepLearning::EDeepLearningInferencePrecision prec) |
| Inference precision. | |
| int | GetNumAvailableDevices () const |
| Available devices for the current EDeepLearningExecutionSettings::SetEngine. | |
| std::string | GetAvailableDeviceName (int i) const |
| Name of the i-th device of the current engine. | |
| eVision::EasyDeepLearning::EDeepLearningDevice | GetAvailableDevice (int i) const |
| Gets the i-th EDeepLearningDevice of the current engine. | |
| std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > | GetAvailableDevices () const |
| Get all available device for the current engine. | |
| int | GetNumDevices () const |
| Number of devices configured in this execution context. | |
| void | SetDevice (const eVision::EasyDeepLearning::EDeepLearningDevice &device) |
| Sets the device with which to run or train the model. | |
| eVision::EasyDeepLearning::EDeepLearningDevice | GetDevice (int i) const |
| Gets an active device. By default, it returns the first active device. | |
| eVision::EasyDeepLearning::EDeepLearningDevice | GetDevice () const |
| Gets an active device. By default, it returns the first active device. | |
| void | SetDeviceByName (const std::string &name) |
| Sets the device with which to run the model using its name. | |
| void | SetDeviceById (int id) |
| Sets the device with which to run the model using its index in the list returned by EDeepLearningExecutionSettings::GetAvailableDevices. | |
| std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > | GetDevices () const |
| Devices with which to run or train the model. | |
| void | SetDevices (const std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > &devices) |
| Devices with which to run or train the model. | |
| void | SetBatchSize (int32_t batchSize) |
| Batch size. The batch size is the number of images that are processed together during training and batch inference. | |
| int32_t | GetBatchSize () const |
| Batch size. The batch size is the number of images that are processed together during training and batch inference. | |
| bool | GetOptimizeBatchSize () const |
| Indicates whether to optimize the batch size (see EDeepLearningExecutionSettings::SetBatchSize) to maximize the training and inference speed according to the engine, device and the available memory. | |
| void | SetOptimizeBatchSize (bool optimize) |
| Indicates whether to optimize the batch size (see EDeepLearningExecutionSettings::SetBatchSize) to maximize the training and inference speed according to the engine, device and the available memory. | |
| EDeepLearningExecutionSettings (CppWrapperInternal::InternalConstructor) | |
Static Public Member Functions | |
| static int | GetNumAvailableEngines () |
| Number of available engines. | |
| static std::string | GetAvailableEngineName (int id) |
| Gets the name of the engine given its id. | |
| static std::vector< std::string > | GetAvailableEngines () |
| Available engines. | |
| static std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > | GetAvailableDevicesForEngine (const std::string &engine) |
| Available devices for the specified engine. | |
Public Attributes | |
| CppWrapperInternal::WrappedClass | wrappedClass_ |
Execution settings for a Deep Learning tool.
License(s): BasicTypes
| eVision::EasyDeepLearning::EDeepLearningExecutionSettings::EDeepLearningExecutionSettings | ( | ) |
Constructs a EDeepLearningExecutionSettings.
| eVision::EasyDeepLearning::EDeepLearningExecutionSettings::EDeepLearningExecutionSettings | ( | const eVision::EasyDeepLearning::EDeepLearningExecutionSettings & | other | ) |
Copy constructor.
| other | The other EDeepLearningExecutionSettings that we will copy into this one. |
|
virtual | ||||||||||||
| eVision::EasyDeepLearning::EDeepLearningExecutionSettings::EDeepLearningExecutionSettings | ( | CppWrapperInternal::InternalConstructor | ) |
| void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::CopyTo | ( | eVision::EasyDeepLearning::EDeepLearningExecutionSettings & | other | ) | const |
Copy the object to another one.
| other | The other EDeepLearningExecutionSettings that we will copy this one into. |
| eVision::EasyDeepLearning::EDeepLearningDevice eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetAvailableDevice | ( | int | i | ) | const |
Gets the i-th EDeepLearningDevice of the current engine.
| i | Index of the device between 0 and EDeepLearningExecutionSettings::GetNumAvailableDevices - 1. |
| std::string eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetAvailableDeviceName | ( | int | i | ) | const |
Name of the i-th device of the current engine.
| i | Index of the device between 0 and EDeepLearningExecutionSettings::GetNumAvailableDevices - 1. |
| std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetAvailableDevices | ( | ) | const |
Get all available device for the current engine.
|
static |
Available devices for the specified engine.
| engine | Engine for which to get the devices |
|
static |
Gets the name of the engine given its id.
| id | Index of the available engine between 0 and EDeepLearningExecutionSettings::GetNumAvailableEngines - 1. |
|
static |
Available engines.
| int32_t eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetBatchSize | ( | ) | const |
Batch size. The batch size is the number of images that are processed together during training and batch inference.
When using multi-GPUs processing, the batch size is the number of images that each GPU will process at once.
A large batch size will increase the processing speed on GPU but also the memory requirements.
The batch size must be bigger or equal to 1 and it is commonly chosen to be a power of 2.
If EDeepLearningExecutionSettings::GetOptimizeBatchSize is 'true', then the value of this property will not be taken into account because it will be optimized automatically for training or inference according to the situation.
| eVision::EasyDeepLearning::EDeepLearningDevice eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetDevice | ( | ) | const |
Gets an active device. By default, it returns the first active device.
| eVision::EasyDeepLearning::EDeepLearningDevice eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetDevice | ( | int | i | ) | const |
Gets an active device. By default, it returns the first active device.
| i | Index of the active devices between 0 and EDeepLearningExecutionSettings::GetNumDevices. |
| std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetDevices | ( | ) | const |
Devices with which to run or train the model.
Using multiple GPUs is only supported by the default engine.
If the specified devices don't support the current EDeepLearningExecutionSettings::GetInferencePrecision, it will be set to EDeepLearningDevice::GetDefaultPrecision.
| std::string eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetEngine | ( | ) | const |
Engine with which to execute or train the neural network.
| eVision::EasyDeepLearning::EDeepLearningInferencePrecision eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetInferencePrecision | ( | ) | const |
Inference precision.
Use EDeepLearningDevice::IsPrecisionSupported to check whether a device support the given precision.
| int eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetNumAvailableDevices | ( | ) | const |
Available devices for the current EDeepLearningExecutionSettings::SetEngine.
|
static |
Number of available engines.
| int eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetNumDevices | ( | ) | const |
Number of devices configured in this execution context.
| bool eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetOptimizeBatchSize | ( | ) | const |
Indicates whether to optimize the batch size (see EDeepLearningExecutionSettings::SetBatchSize) to maximize the training and inference speed according to the engine, device and the available memory.
Default value is true.
|
virtual |
Loads the EDeepLearningExecutionSettings. The given ESerializer must have been created for reading.
| filePath | File path. |
Loading a EDeepLearningExecutionSettings can trigger exceptions if the engine and/or device is not available on the machine.
|
virtual |
Loads the EDeepLearningExecutionSettings. The given ESerializer must have been created for reading.
| serializer | Pointer to the ESerializer created for reading. |
Loading a EDeepLearningExecutionSettings can trigger exceptions if the engine and/or device is not available on the machine.
| bool eVision::EasyDeepLearning::EDeepLearningExecutionSettings::operator!= | ( | const eVision::EasyDeepLearning::EDeepLearningExecutionSettings & | other | ) | const |
Inequality operator.
| other | Other execution settings |
| eVision::EasyDeepLearning::EDeepLearningExecutionSettings & eVision::EasyDeepLearning::EDeepLearningExecutionSettings::operator= | ( | const eVision::EasyDeepLearning::EDeepLearningExecutionSettings & | other | ) |
Assignment operator.
| other | The other EDeepLearningExecutionSettings that we will copy into this one. |
| bool eVision::EasyDeepLearning::EDeepLearningExecutionSettings::operator== | ( | const eVision::EasyDeepLearning::EDeepLearningExecutionSettings & | other | ) | const |
Comparison operator.
| other | Other execution settings |
|
virtual |
Saves the EDeepLearningExecutionSettings. The given ESerializer must have been created for writing.
| filePath | File path. |
|
virtual |
Saves the EDeepLearningExecutionSettings. The given ESerializer must have been created for writing.
| serializer | Pointer to the ESerializer created for writing. |
| void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetBatchSize | ( | int32_t | batchSize | ) |
Batch size. The batch size is the number of images that are processed together during training and batch inference.
When using multi-GPUs processing, the batch size is the number of images that each GPU will process at once.
A large batch size will increase the processing speed on GPU but also the memory requirements.
The batch size must be bigger or equal to 1 and it is commonly chosen to be a power of 2.
| batchSize | Size of the batch |
If EDeepLearningExecutionSettings::GetOptimizeBatchSize is 'true', then the value of this property will not be taken into account because it will be optimized automatically for training or inference according to the situation.
| void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetDevice | ( | const eVision::EasyDeepLearning::EDeepLearningDevice & | device | ) |
Sets the device with which to run or train the model.
| device | Device |
For CPU device, the number of thread is initialized from Easy::SetMaxNumberOfProcessingThreads.
If the specified device does support the current EDeepLearningExecutionSettings::GetInferencePrecision, it will be set to EDeepLearningDevice::GetDefaultPrecision.
| void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetDeviceById | ( | int | id | ) |
Sets the device with which to run the model using its index in the list returned by EDeepLearningExecutionSettings::GetAvailableDevices.
| void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetDeviceByName | ( | const std::string & | name | ) |
Sets the device with which to run the model using its name.
| void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetDevices | ( | const std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > & | devices | ) |
Devices with which to run or train the model.
Using multiple GPUs is only supported by the default engine.
| devices | Device |
If the specified devices don't support the current EDeepLearningExecutionSettings::GetInferencePrecision, it will be set to EDeepLearningDevice::GetDefaultPrecision.
| void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetEngine | ( | const std::string & | engine | ) |
Engine with which to execute or train the neural network.
| void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetInferencePrecision | ( | eVision::EasyDeepLearning::EDeepLearningInferencePrecision | prec | ) |
Inference precision.
Use EDeepLearningDevice::IsPrecisionSupported to check whether a device support the given precision.
| void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetOptimizeBatchSize | ( | bool | optimize | ) |
Indicates whether to optimize the batch size (see EDeepLearningExecutionSettings::SetBatchSize) to maximize the training and inference speed according to the engine, device and the available memory.
Default value is true.
| CppWrapperInternal::WrappedClass eVision::EasyDeepLearning::EDeepLearningExecutionSettings::wrappedClass_ |