Files
tensorneat-mend/tensorneat/problem/func_fit/xor.py
wls2002 18c3d44c79 complete fully stateful!
use black to format all files!
2024-05-26 18:08:43 +08:00

25 lines
466 B
Python

import numpy as np
from .func_fit import FuncFit
class XOR(FuncFit):
def __init__(self, error_method: str = "mse"):
super().__init__(error_method)
@property
def inputs(self):
return np.array([[0, 0], [0, 1], [1, 0], [1, 1]])
@property
def targets(self):
return np.array([[0], [1], [1], [0]])
@property
def input_shape(self):
return 4, 2
@property
def output_shape(self):
return 4, 1