Deeplearning/Qtorch/Models/QSVM.py

15 lines
453 B
Python
Raw Permalink Normal View History

2024-10-07 09:54:32 +08:00
from Qtorch.Models.Qnn import Qnn
from abc import ABC, abstractmethod
class QSVM(Qnn, ABC):
def __init__(self, data, labels=None, test_size=0.2, random_state=None):
super().__init__(data, labels, test_size, random_state)
self.result.update({
"pca_2d" : None,
"pca_3d" : None
})
@abstractmethod
def train_model(self, train_loader, test_loader, epochs):
return super().train_model(train_loader, test_loader, epochs)