Skip to content

Instantly share code, notes, and snippets.

View DrJonnyT's full-sized avatar

Jonny Taylor DrJonnyT

  • University of Manchester
  • Manchester, UK
  • X @DrJonnyT
View GitHub Profile
@DrJonnyT
DrJonnyT / tf_torch_nps_comparison
Last active April 29, 2024 08:48
Tensorflow Pytorch comparison using neuralprocesses library
"""Script to compare the tensorflow and pytorch implementations of neuralprocesses.
The training losses printed at the end should be very similar, the differences are
thought to be due to different random seeds.
This script currently works for gnp, agnp, and convgnp architectures (defined
on L93 & 94).
"""
import tensorflow as tf
import torch
import numpy as np