Hello,
I implement a fancy non-backpropagation based approach to deep learning with PyTorch and try to solve XOR. It's rather simple. I guess the theoretical details don't matter. I have three files: run_XOR.py, networks.py and data.py. I have two torch models, one is very classical the other the fancy one whereas teh classical generates a "signal" to control the other one. Anyway, that shouldn't really matter much.
I try to solve a continual learning problem on XOR with that. So I have output like this:
Task 1 - Performance on Task 1: 50.00%
Task 2 - Performance on Task 1: 50.00%
Task 2 - Performance on Task 2: 50.00%
Task 3 - Performance on Task 1: 50.00%
Task 3 - Performance on Task 2: 50.00%
Task 3 - Performance on Task 3: 50.00%
First task 1, then we train on task 2 but also try to solve task 1, same with task 3. The problem now is that if I run python run_XOR.py on my cluster vs. locally, I get different performances. I use optuna to search for the hyperparameters.
Optuna should be implemented ocrrectly. I only use it on a single core because sqlite doesn't support parallelism. I checked the results optuna provides and that works (locally reps. on teh cluster)
Now if I run the experiment for a certain set of paramteres locally, I get different results on my cluster and I don't know why.
inside run_XOR.py I have a function run_experiment() that does:
torch.manual_seed(seed)
np.random.seed(seed)
random.seed(seed)
Then inside data.py I also fix the shuffling of the data:
def get_dataloader(task_id, batch_size=32, seed=0):
dataset = ContinualLearningDataset(task_id)
sampler = RandomSampler(dataset, generator=torch.Generator().manual_seed(seed))
return DataLoader(dataset, batch_size=batch_size, sampler=sampler, shuffle=False)
- I also use
torch.randn_liketo generate data but that should should the fixed seed. - I don't init weights of models.
- I don't do anything in parallel.