API Reference - Models - Diffusion
RandomNetworkDistillation is a neural network for producing internal rewards to encourage exploration. Requires neural network as your model.
Constructors
new()
Create new model object. If any of the arguments are nil, default argument values for that argument will be used.
Diffusion.new({Model: Model, numberOfDiffusionStep: number, numberOfSamplingStep: number, sampler: string, noiseScheduler: string, initialNoiseValue: number, finalNoiseValue: number}): RandomNetworkDistillationObject
Parameters
-
Model: The model to be used for diffusion and sampling.
-
numberOfDiffusionStep: The number of diffusion steps to be performed when calling the train() function. [Default: 300]
-
numberOfSamplingStep: The number of sampling steps to be performed when calling the generate() function. [Default: 300]
-
sampler: The sampler to be used for denoising the feature tensor. Available options are:
-
Euler
-
DDPM (Default)
-
-
noiseScheduler: The noise scheduler to be used for adding noise to the feature tensor. Available options are:
- Linear (Default)
-
initialNoiseValue: The initial noise value to generate noise values. [Default: 0.0001]
-
finalNoiseValue: The final noise value to generate noise values. [Default: 1]
Returns
- Model: The generated model object.
Functions
diffuse()
Diffusion:diffuse(featureTensor: tensor, alpha: number)
Parameters
-
featureTensor: The tensor containing all the features.
-
alpha: The amount of features that are retained.
train()
Diffusion:train(featureTensor: tensor)
Parameters
- featureTensor: The tensor containing all the features.
sample()
Diffusion:sample(featureTensor: tensor, alpha: number, cumulativeAlpha: number, currentStandardDeviation: number, nextStandardDeviation: number): tensor
Parameters
-
featureTensor: The tensor containing all the features.
-
alpha: The amount of features that are retained.
-
cumulativeAlpha: The cumulative amount of features that are retained.
-
currentStandardDeviation: The standard deviation for the current sampling step.
-
nextStandardDeviation: The standard deviation for the next sampling step.
Returns
- outputTensor: The tensor generated by the model from the given feature tensor.
generate()
Diffusion:generate(featureTensor: tensor): tensor
Parameters
- featureTensor: The tensor containing all the features.
Returns
- outputTensor: The tensor generated by the model from the given feature tensor.