Avalon.Conv1d
— Type1D convolutional layer.
Input and output dimensions: (sequencelength, channels, batchsize)
Avalon.getbatch
— Methodgetbatch(dataset, i::Int, sz::Int)
Get batch of data from the specified dataset.
- i - batch index
- sz - size of the batch
Typical implementation for continuous datasets:
start = (i-1)*sz + 1
finish = min(i*sz, length(dataset))
return start <= finish ? dataset[start:finish] : nothing
Avalon.ignored_field
— MethodShould we ignore field with this path when updating the struct?
Avalon.nllloss
— MethodNegative log-likelihood. ŷ should be a vector of normalized log probabilities.
Avalon.to_device
— MethodConvert object to a compatible with the specified device. For CPU it's usually no-op. For GPU behavior differs between object types:
- Arrays are converted to CuArrays
- structs are converted recursively
- functions are looked up using
device_function()
or transformed using tracer - all other objects are returned as is
Avalon.walkstruct
— MethodWalk fields of struct s
applying callback function cb
. If cb
returns nothing, recursively call walkstruct()
on each field.
Avalon.@ignore
— MacroIgnore this field when updating the struct. Example:
mutable struct MyModel linear::Linear end
@ignore MyModel.linear.b