Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XOR dataset always produces labels of 1 #1

Open
atroche opened this issue May 20, 2024 · 0 comments
Open

XOR dataset always produces labels of 1 #1

atroche opened this issue May 20, 2024 · 0 comments

Comments

@atroche
Copy link

atroche commented May 20, 2024

When I download and run xor-classifier.py with this loop added in to the _gen_data function:

    def _gen_data(self, rng, std):
        self.data = rng.randint(low=0, high=2, size=(self.size, 2)).astype(np.float32)
        self.data += rng.normal(loc=0.0, scale=std, size=self.data.shape)
        self.label = (self.data[:, 0] != self.data[:, 1]).astype(np.int32)
        for i in range(len(self.data)):
            label = self.label[i]
            if label != 1:
                raise ValueError(f'Label is not 1: {label}')

…the exception is never thrown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant