Extending SecML¶
We provide details on how to implement new library modules, extending our abstract interfaces.
Remember to check out latest version and roadmap before developing new code.
Abstract Base Classes¶
The packages’s abstract superclasses (e.g. CClassifier
) expose
public methods that call inner abstract methods. If you are creating a new
extension, inherit from one of these classes, taking care of reading the
superclass code and check out the inner methods that you need to implement.
New extensions should handle our main data type CArray
.
This class wraps the dense numpy numpy.ndarray
and the scipy sparse
scipy.sparse.csr_matrix
, so that they have the same interface
for the user.
The shape of a CArray
is either a vector or a matrix (multi-dimensional
arrays will be added in a future version) of rows where each row represents
a sample.
Two CArray
are needed to compose a CDataset
that can be used to store samples (attribute X) and labels (attribute Y).
Creating new extensions¶
The following guides illustrate how to extend the superclasses for the different packages of the library:
CClassifier - classifiers including Deep Neural Networks.
The following contribution guides will be added in a future versions.
Data processing
CPreprocess
CKernel
Data
CDataLoader
Visualization
CPlot
Attacks
Optimization