1D convolutional layer.

Input and output dimensions: (sequencelength, channels, batchsize)


getbatch(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

Negative log-likelihood. ŷ should be a vector of normalized log probabilities.


Convert 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

Walk fields of struct s applying callback function cb. If cb returns nothing, recursively call walkstruct() on each field.


Ignore this field when updating the struct. Example:

mutable struct MyModel linear::Linear end

@ignore MyModel.linear.b