Skip to content

Deserialization for Kernel #221

Closed
@Mec-iS

Description

@Mec-iS

Kernel is now an object-safe trait so we can use its type as &dyn Kernel, it has also a name() function to have a string representation of the kernel as LinearKernel, RBFKernel, ...

We would like to provide a functionality that instantiate the kernel's default from a string:

"LinearKernel" -> LinearKernel::Default()

via a enum

pub enum KernelName {
    Linear(LinearKernel),
   ...
}

This possibility is known to be not possible in vanilla Rust but there is a library that provides it, see blogpost.

This feature should be only available and loaded in pairing with the "serde" feature so to avoid adding another library to the deps.

This will allow parameters that contain pub kernel: Option<&'a dyn Kernel<'a>>, to be deserializable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions