40 gzUInt32
values, gzUInt32 width = 0, gzUInt32 height = 0,
42 const gzString& spatialGroup = GZ_EMPTY_STRING,
43 const gzString& associatedComponent = GZ_EMPTY_STRING);
68 gzString m_spatialGroup;
69 gzString m_associatedComponent;
70 gzArray<gzFloat> m_values;
95 gzDynamicArray<ctxDataComponent> m_components;
110 gzArray<gzFloat>& target)
const = 0;
135 gzUInt32& sampleCount)
const;
140 gzUInt32 m_firstSample;
141 gzUInt32 m_sampleCount;
153 gzFloat step = 1.0f, gzFloat targetScale = 1.0f, gzFloat targetOffset = 0.0f);
158 gzArray<gzFloat>& target)
const;
165 gzFloat m_targetScale;
166 gzFloat m_targetOffset;
178 gzUInt32 categories = 10, gzBool normalize = TRUE);
187 gzArray<gzFloat>& target)
const;
194 gzUInt32 m_categories;
196 gzArray<gzUByte> m_images;
197 gzArray<gzUByte> m_labels;
210 gzArray<gzFloat>& target)
const = 0;
225 gzArray<gzFloat>& target)
const;
243 gzArray<gzFloat>& target)
const;
248 mutable gzRefList<ctxDataTransform> m_transforms;
263 gzArray<gzFloat>& target)
const;
282 gzFloat probability = 0.5f);
286 gzArray<gzFloat>& target)
const;
292 gzString m_spatialGroup;
293 gzFloat m_probability;
319 gzArray<gzFloat>& target)
const;
321 const gzArray<gzFloat>& target);
328 gzUInt32 m_inputSize;
329 gzUInt32 m_targetSize;
333 gzDynamicArray<ctxDataSamplePtr> m_dataSamples;
360 gzUInt32 index)
const;
367 gzVoid configure(gzUInt32 capacity, gzUInt32 inputSize, gzUInt32 targetSize);
368 gzBool configure(gzUInt32 capacity,
const ctxDataSample& sample, gzString& error);
369 gzBool append(gzUInt32 page, gzUInt32 sampleIndex,
const ctxDataSample& sample,
374 gzUInt32 m_inputSize;
375 gzUInt32 m_targetSize;
376 gzArray<gzUInt32> m_sampleIndices;
377 gzArray<gzFloat> m_inputValues;
378 gzArray<gzFloat> m_targetValues;
379 gzDynamicArray<ctxDataComponent> m_components;
380 gzDynamicArray<gzArray<gzFloat> > m_componentValues;
381 gzDynamicArray<gzArray<gzString> > m_componentMetadata;
404 gzRefList<ctxDataBatch> m_batches;
417 gzBool shuffle = FALSE, gzUInt32 seed = 0, gzUInt32 firstSample = 0,
420 gzBool shuffle = FALSE, gzUInt32 seed = 0);
435 gzUInt32 nextRandom();
437 gzBool fillPrefetch();
439 ctxDatasetPtr m_dataset;
440 ctxDataTransformPtr m_preprocess;
441 ctxDataTransformPtr m_augmentation;
442 ctxDataCachePtr m_cache;
443 ctxDataPrefetchPtr m_prefetch;
444 gzArray<gzUInt32> m_order;
445 gzUInt32 m_batchSize;
446 gzUInt32 m_firstSample;
447 gzUInt32 m_sampleCount;
449 gzUInt32 m_randomState;
452 gzBool m_augmentationEnabled;
465 const gzString& component = GZ_EMPTY_STRING);
469 gzUInt32 sample = 0);
476 gzUInt32 m_expectedSize;
477 gzString m_component;
478 gzUInt32 m_componentIndex;
479 ctxDataBatchPtr m_batch;
490 const gzString& component = GZ_EMPTY_STRING);
501 gzUInt32 m_expectedSize;
502 gzString m_component;
503 gzUInt32 m_componentIndex;
504 ctxDataBatchPtr m_batch;
virtual gzUInt32 getResultSize()
virtual gzUInt32 getResults()
virtual gzFloat getExpectedValue(ctxContext *context, gzUInt32 index, gzUInt32 sample)
gzBool bind(ctxDataBatch *batch)
ctxBatchTargetBinding(const gzString &port=GZ_EMPTY_STRING, gzUInt32 expectedSize=CTX_UNDEFINED_INDEX, const gzString &component=GZ_EMPTY_STRING)
gzUInt32 getComponents() const
gzUInt32 getTargetSize() const
friend class ctxDataLoader
gzUInt32 getComponentHeight(gzUInt32 component) const
ctxDataComponentKind getComponentKind(gzUInt32 component) const
gzUInt32 getInputSize() const
gzUInt32 getComponentWidth(gzUInt32 component) const
gzFloat getInputValue(gzUInt32 page, gzUInt32 index) const
gzUInt32 getSampleIndex(gzUInt32 page) const
gzUInt32 findComponent(ctxDataComponentKind kind, const gzString &name) const
gzFloat getComponentValue(gzUInt32 page, gzUInt32 component, gzUInt32 index) const
gzFloat getTargetValue(gzUInt32 page, gzUInt32 index) const
gzString getComponentName(gzUInt32 component) const
gzUInt32 getComponentSize(gzUInt32 component) const
friend class ctxDataPrefetch
gzUInt32 getCapacity() const
gzString getComponentMetadata(gzUInt32 page, gzUInt32 component) const
ctxDataCache(ctxDataCacheStage stage=CTX_DATA_CACHE_DETERMINISTIC)
gzVoid reserve(gzUInt32 samples)
ctxDataCacheStage getStage() const
gzBool get(gzUInt32 sample, ctxDataSample &data) const
gzBool get(gzUInt32 sample, gzArray< gzFloat > &input, gzArray< gzFloat > &target) const
gzBool put(gzUInt32 sample, const gzArray< gzFloat > &input, const gzArray< gzFloat > &target)
gzBool put(gzUInt32 sample, const ctxDataSample &data)
ctxDataInterpolation getInterpolation() const
gzBool isMetadata() const
gzBool setMetadata(const gzString &value)
gzArray< gzFloat > & values()
gzUInt32 getValueCount() const
gzUInt32 getHeight() const
ctxDataComponentKind getKind() const
gzFloat getValue(gzUInt32 index) const
const gzArray< gzFloat > & values() const
gzUInt32 getWidth() const
gzBool setValue(gzUInt32 index, gzFloat value)
gzString getAssociatedComponent() const
gzString getMetadata() const
ctxDataComponent(ctxDataComponentKind kind, const gzString &name, gzUInt32 values, gzUInt32 width=0, gzUInt32 height=0, ctxDataInterpolation interpolation=CTX_DATA_INTERPOLATION_NONE, const gzString &spatialGroup=GZ_EMPTY_STRING, const gzString &associatedComponent=GZ_EMPTY_STRING)
gzString getSpatialGroup() const
gzBool setCache(ctxDataCache *cache)
gzBool setTransform(ctxDataTransform *transform)
ctxDataLoader(ctxDataset *dataset, gzUInt32 batchSize, gzBool shuffle=FALSE, gzUInt32 seed=0, gzUInt32 firstSample=0, gzUInt32 sampleCount=CTX_UNDEFINED_INDEX)
gzString getError() const
gzBool setPrefetch(ctxDataPrefetch *prefetch)
gzUInt32 getBatchSize() const
gzUInt32 getSamples() const
gzBool next(ctxDataBatch *batch)
gzBool setPreprocess(ctxDataTransform *transform)
gzBool setAugmentation(ctxDataTransform *transform)
gzVoid setAugmentationEnabled(gzBool enabled)
gzBool reset(gzUInt32 epoch=0)
ctxDataLoader(ctxDataset *dataset, ctxDatasetSplit *split, gzUInt32 batchSize, gzBool shuffle=FALSE, gzUInt32 seed=0)
gzUInt32 getReady() const
friend class ctxDataLoader
gzBool setBatches(gzUInt32 batches)
ctxDataPrefetch(gzUInt32 batches=1)
gzUInt32 getBatches() const
gzUInt32 count(ctxDataComponentKind kind) const
ctxDataComponent * find(ctxDataComponentKind kind, const gzString &name)
virtual gzBool useDeepCopy() override
gzBool validate(gzString &error) const
ctxDataSample(const ctxDataSample ©)
ctxDataComponent * getComponent(gzUInt32 index)
const ctxDataComponent * getComponent(gzUInt32 index) const
gzBool add(const ctxDataComponent &component)
gzUInt32 getComponents() const
const ctxDataComponent * find(ctxDataComponentKind kind, const gzString &name) const
virtual gzUInt32 getInputSize() const =0
virtual gzUInt32 getTargetSize() const =0
virtual gzBool readSample(gzUInt32 sample, gzArray< gzFloat > &input, gzArray< gzFloat > &target) const =0
virtual gzBool readDataSample(gzUInt32 sample, ctxDataSample &data) const
virtual gzUInt32 getSamples() const =0
gzUInt32 getFirstSample() const
gzBool resolve(ctxDataset *dataset, gzUInt32 &firstSample, gzUInt32 &sampleCount) const
ctxDatasetSplitKind getKind() const
gzUInt32 getSampleCount() const
ctxDatasetSplit(ctxDatasetSplitKind kind, gzUInt32 firstSample, gzUInt32 sampleCount=CTX_UNDEFINED_INDEX)
virtual gzUInt32 getInputSize() const
virtual gzUInt32 getSamples() const
ctxGeneratedScalarDataset(gzUInt32 samples, gzFloat first=0.0f, gzFloat step=1.0f, gzFloat targetScale=1.0f, gzFloat targetOffset=0.0f)
virtual gzBool readSample(gzUInt32 sample, gzArray< gzFloat > &input, gzArray< gzFloat > &target) const
virtual gzUInt32 getTargetSize() const
virtual gzUInt32 getInputSize() const
gzUInt32 getColumns() const
gzString getError() const
virtual gzUInt32 getTargetSize() const
virtual gzBool readSample(gzUInt32 sample, gzArray< gzFloat > &input, gzArray< gzFloat > &target) const
ctxIdxDataset(const gzString &imageURL, const gzString &labelURL, gzUInt32 categories=10, gzBool normalize=TRUE)
virtual gzUInt32 getSamples() const
@ CTX_DATA_TRANSFORM_AUGMENTATION
@ CTX_DATA_TRANSFORM_PREPROCESS
@ CTX_DATA_COMPONENT_TARGET
@ CTX_DATA_COMPONENT_WEIGHT
@ CTX_DATA_COMPONENT_METADATA
@ CTX_DATA_COMPONENT_MASK
@ CTX_DATA_COMPONENT_INPUT
@ CTX_DATA_SPLIT_VALIDATION
@ CTX_DATA_INTERPOLATION_NEAREST
@ CTX_DATA_INTERPOLATION_LINEAR
@ CTX_DATA_INTERPOLATION_NONE
@ CTX_DATA_CACHE_DETERMINISTIC
const gzUInt32 CTX_UNDEFINED_INDEX