eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::EasyDeepLearning::EDeepLearningExecutionSettings Class Reference

Execution settings for a Deep Learning tool. More...

#include <eVision/Easy/EasyDeepLearning/EDeepLearningExecutionSettings.h>

Collaboration diagram for eVision::EasyDeepLearning::EDeepLearningExecutionSettings:

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_

Detailed Description

Execution settings for a Deep Learning tool.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ EDeepLearningExecutionSettings() [1/3]

eVision::EasyDeepLearning::EDeepLearningExecutionSettings::EDeepLearningExecutionSettings ( )

◆ EDeepLearningExecutionSettings() [2/3]

eVision::EasyDeepLearning::EDeepLearningExecutionSettings::EDeepLearningExecutionSettings ( const eVision::EasyDeepLearning::EDeepLearningExecutionSettings & other)

Copy constructor.

Parameters
otherThe other EDeepLearningExecutionSettings that we will copy into this one.

◆ ~EDeepLearningExecutionSettings()

eVision::EasyDeepLearning::EDeepLearningExecutionSettings::~EDeepLearningExecutionSettings ( )
throw ( )
virtual

◆ EDeepLearningExecutionSettings() [3/3]

eVision::EasyDeepLearning::EDeepLearningExecutionSettings::EDeepLearningExecutionSettings ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ CopyTo()

void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::CopyTo ( eVision::EasyDeepLearning::EDeepLearningExecutionSettings & other) const

Copy the object to another one.

Parameters
otherThe other EDeepLearningExecutionSettings that we will copy this one into.

◆ GetAvailableDevice()

eVision::EasyDeepLearning::EDeepLearningDevice eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetAvailableDevice ( int i) const

Gets the i-th EDeepLearningDevice of the current engine.

Parameters
iIndex of the device between 0 and EDeepLearningExecutionSettings::GetNumAvailableDevices - 1.

◆ GetAvailableDeviceName()

std::string eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetAvailableDeviceName ( int i) const

Name of the i-th device of the current engine.

Parameters
iIndex of the device between 0 and EDeepLearningExecutionSettings::GetNumAvailableDevices - 1.

◆ GetAvailableDevices()

std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetAvailableDevices ( ) const

Get all available device for the current engine.

◆ GetAvailableDevicesForEngine()

std::vector< eVision::EasyDeepLearning::EDeepLearningDevice > eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetAvailableDevicesForEngine ( const std::string & engine)
static

Available devices for the specified engine.

Parameters
engineEngine for which to get the devices

◆ GetAvailableEngineName()

std::string eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetAvailableEngineName ( int id)
static

Gets the name of the engine given its id.

Parameters
idIndex of the available engine between 0 and EDeepLearningExecutionSettings::GetNumAvailableEngines - 1.

◆ GetAvailableEngines()

std::vector< std::string > eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetAvailableEngines ( )
static

Available engines.

◆ GetBatchSize()

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.

◆ GetDevice() [1/2]

eVision::EasyDeepLearning::EDeepLearningDevice eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetDevice ( ) const

Gets an active device. By default, it returns the first active device.

◆ GetDevice() [2/2]

eVision::EasyDeepLearning::EDeepLearningDevice eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetDevice ( int i) const

Gets an active device. By default, it returns the first active device.

Parameters
iIndex of the active devices between 0 and EDeepLearningExecutionSettings::GetNumDevices.

◆ GetDevices()

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.

◆ GetEngine()

std::string eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetEngine ( ) const

Engine with which to execute or train the neural network.

◆ GetInferencePrecision()

eVision::EasyDeepLearning::EDeepLearningInferencePrecision eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetInferencePrecision ( ) const

Inference precision.

Use EDeepLearningDevice::IsPrecisionSupported to check whether a device support the given precision.

◆ GetNumAvailableDevices()

int eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetNumAvailableDevices ( ) const

Available devices for the current EDeepLearningExecutionSettings::SetEngine.

◆ GetNumAvailableEngines()

int eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetNumAvailableEngines ( )
static

Number of available engines.

◆ GetNumDevices()

int eVision::EasyDeepLearning::EDeepLearningExecutionSettings::GetNumDevices ( ) const

Number of devices configured in this execution context.

◆ GetOptimizeBatchSize()

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.

◆ Load() [1/2]

void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::Load ( const std::string & filePath)
virtual

Loads the EDeepLearningExecutionSettings. The given ESerializer must have been created for reading.

Parameters
filePathFile path.

Loading a EDeepLearningExecutionSettings can trigger exceptions if the engine and/or device is not available on the machine.

◆ Load() [2/2]

void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::Load ( eVision::ESerializer * serializer)
virtual

Loads the EDeepLearningExecutionSettings. The given ESerializer must have been created for reading.

Parameters
serializerPointer to the ESerializer created for reading.

Loading a EDeepLearningExecutionSettings can trigger exceptions if the engine and/or device is not available on the machine.

◆ operator!=()

bool eVision::EasyDeepLearning::EDeepLearningExecutionSettings::operator!= ( const eVision::EasyDeepLearning::EDeepLearningExecutionSettings & other) const

Inequality operator.

Parameters
otherOther execution settings

◆ operator=()

eVision::EasyDeepLearning::EDeepLearningExecutionSettings & eVision::EasyDeepLearning::EDeepLearningExecutionSettings::operator= ( const eVision::EasyDeepLearning::EDeepLearningExecutionSettings & other)

Assignment operator.

Parameters
otherThe other EDeepLearningExecutionSettings that we will copy into this one.

◆ operator==()

bool eVision::EasyDeepLearning::EDeepLearningExecutionSettings::operator== ( const eVision::EasyDeepLearning::EDeepLearningExecutionSettings & other) const

Comparison operator.

Parameters
otherOther execution settings

◆ Save() [1/2]

void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::Save ( const std::string & filePath)
virtual

Saves the EDeepLearningExecutionSettings. The given ESerializer must have been created for writing.

Parameters
filePathFile path.

◆ Save() [2/2]

void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::Save ( eVision::ESerializer * serializer)
virtual

Saves the EDeepLearningExecutionSettings. The given ESerializer must have been created for writing.

Parameters
serializerPointer to the ESerializer created for writing.

◆ SetBatchSize()

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.

Parameters
batchSizeSize 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.

◆ SetDevice()

void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetDevice ( const eVision::EasyDeepLearning::EDeepLearningDevice & device)

Sets the device with which to run or train the model.

Parameters
deviceDevice

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.

◆ SetDeviceById()

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.

◆ SetDeviceByName()

void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetDeviceByName ( const std::string & name)

Sets the device with which to run the model using its name.

◆ SetDevices()

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.

Parameters
devicesDevice

If the specified devices don't support the current EDeepLearningExecutionSettings::GetInferencePrecision, it will be set to EDeepLearningDevice::GetDefaultPrecision.

◆ SetEngine()

void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetEngine ( const std::string & engine)

Engine with which to execute or train the neural network.

◆ SetInferencePrecision()

void eVision::EasyDeepLearning::EDeepLearningExecutionSettings::SetInferencePrecision ( eVision::EasyDeepLearning::EDeepLearningInferencePrecision prec)

Inference precision.

Use EDeepLearningDevice::IsPrecisionSupported to check whether a device support the given precision.

◆ SetOptimizeBatchSize()

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.

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::EasyDeepLearning::EDeepLearningExecutionSettings::wrappedClass_