56 import daal.algorithms.math.smoothrelu
as smoothrelu
57 from daal.data_management
import FileDataSource, DataSourceIface
59 utils_folder = os.path.realpath(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
60 if utils_folder
not in sys.path:
61 sys.path.insert(0, utils_folder)
62 from utils
import printNumericTable
65 datasetName = os.path.join(
'..',
'data',
'batch',
'covcormoments_dense.csv')
67 if __name__ ==
"__main__":
70 dataSource = FileDataSource(datasetName,
71 DataSourceIface.doAllocateNumericTable,
72 DataSourceIface.doDictionaryFromContext)
73 dataSource.loadDataBlock()
76 algorithm = smoothrelu.Batch()
79 algorithm.input.set(smoothrelu.data, dataSource.getNumericTable())
82 res = algorithm.compute()
85 printNumericTable(res.get(smoothrelu.value),
"SmoothReLU result (first 5 rows):", 5)