deepmind-research
This repository contains implementations and illustrative code to accompany DeepMind publications
Top Related Projects
Models and examples built with TensorFlow
Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
A set of examples around pytorch in Vision, Text, Reinforcement Learning, etc.
🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
OpenAI Baselines: high-quality implementations of reinforcement learning algorithms
Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
Quick Overview
The google-deepmind/deepmind-research repository is a collection of DeepMind's research projects and implementations. It showcases various cutting-edge machine learning and artificial intelligence techniques, algorithms, and models developed by DeepMind researchers. The repository serves as a resource for the AI research community to explore and build upon DeepMind's work.
Pros
- Provides access to state-of-the-art AI research implementations
- Covers a wide range of AI topics, including reinforcement learning, computer vision, and natural language processing
- Offers opportunities for researchers and developers to learn from and extend DeepMind's work
- Regularly updated with new projects and improvements
Cons
- Some projects may have limited documentation or support
- Not all projects are maintained or updated regularly
- The complexity of some implementations may be challenging for beginners
- Some projects may require significant computational resources to run
Code Examples
As this repository contains multiple projects, each with its own codebase, it's not possible to provide specific code examples that apply to the entire repository. However, here are a few examples of how you might interact with some of the projects:
- Using the BigBiGAN model:
import tensorflow as tf
from bigbigan import BigBiGAN
model = BigBiGAN()
x = tf.random.normal([1, 128, 128, 3])
z = model.encode(x)
x_recon = model.generate(z)
- Running a Hanabi agent:
from hanabi_learning_environment import rl_env
from hanabi_agents import rainbow_agent
env = rl_env.make('Hanabi-Full', num_players=2)
agent = rainbow_agent.RainbowAgent(env.observation_space, env.action_space)
obs = env.reset()
while not done:
action = agent.act(obs)
obs, reward, done, _ = env.step(action)
- Using the Perceiver IO model:
import jax
from perceiver_io import perceiver_io
model = perceiver_io.PerceiverIO()
x = jax.random.normal(jax.random.PRNGKey(0), (1, 224, 224, 3))
output = model(x)
Getting Started
To get started with a specific project in the deepmind-research repository:
-
Clone the repository:
git clone https://github.com/google-deepmind/deepmind-research.git cd deepmind-research
-
Navigate to the project directory of interest:
cd project_name
-
Install the required dependencies (usually listed in a requirements.txt file):
pip install -r requirements.txt
-
Follow the project-specific README or documentation for further instructions on running the code or experiments.
Note that each project may have different setup requirements and dependencies, so be sure to read the project-specific documentation carefully.
Competitor Comparisons
Models and examples built with TensorFlow
Pros of models
- Broader scope, covering a wide range of machine learning applications
- More extensive documentation and tutorials for beginners
- Larger community and more frequent updates
Cons of models
- Less focus on cutting-edge research compared to deepmind-research
- May include more deprecated or outdated models
Code Comparison
models:
import tensorflow as tf
from official.nlp import bert
model = bert.BertModel(config=bert_config)
outputs = model(input_ids, attention_mask=input_mask)
deepmind-research:
import jax
import haiku as hk
from acme import specs
model = hk.nets.MLP([64, 64, 5])
action = model(observation)
The code snippets show different approaches:
- models uses TensorFlow and focuses on pre-built models like BERT
- deepmind-research uses JAX and Haiku, emphasizing flexibility for custom research implementations
Both repositories offer valuable resources for machine learning practitioners, with models providing a more accessible entry point for beginners and a wider range of applications, while deepmind-research focuses on cutting-edge research implementations.
Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
Pros of fairseq
- More focused on sequence-to-sequence learning and natural language processing tasks
- Provides a comprehensive toolkit for training custom models and running inference
- Actively maintained with frequent updates and contributions from the community
Cons of fairseq
- Narrower scope compared to deepmind-research's diverse range of AI topics
- May require more domain-specific knowledge to utilize effectively
- Less emphasis on cutting-edge research papers and novel algorithms
Code Comparison
fairseq:
from fairseq.models.transformer import TransformerModel
en2de = TransformerModel.from_pretrained(
'/path/to/checkpoints',
checkpoint_file='checkpoint_best.pt',
data_name_or_path='data-bin/wmt16_en_de_bpe32k'
)
en2de.translate('Hello world!')
deepmind-research:
import sonnet as snt
import tensorflow as tf
class MLP(snt.Module):
def __init__(self, output_sizes):
super().__init__()
self.layers = [snt.Linear(size) for size in output_sizes]
def __call__(self, x):
for layer in self.layers[:-1]:
x = tf.nn.relu(layer(x))
return self.layers[-1](x)
The code snippets highlight the different focus areas of the repositories. fairseq provides high-level APIs for NLP tasks, while deepmind-research offers more general-purpose machine learning components.
A set of examples around pytorch in Vision, Text, Reinforcement Learning, etc.
Pros of examples
- More beginner-friendly with straightforward implementations of common models and tasks
- Wider range of examples covering various domains in machine learning
- Better documentation and explanations for each example
Cons of examples
- Less cutting-edge research implementations compared to deepmind-research
- Fewer complex, state-of-the-art models and algorithms
- Limited focus on advanced AI research areas
Code Comparison
examples:
import torch
import torch.nn as nn
import torch.optim as optim
model = nn.Linear(10, 1)
optimizer = optim.SGD(model.parameters(), lr=0.01)
deepmind-research:
import sonnet as snt
import tensorflow as tf
model = snt.Linear(output_size=1)
optimizer = snt.optimizers.SGD(learning_rate=0.01)
The examples repository uses PyTorch, while deepmind-research primarily uses TensorFlow and Sonnet (DeepMind's TensorFlow-based library). The examples code is more straightforward and accessible, while deepmind-research tends to use more advanced and custom implementations.
🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
Pros of transformers
- Extensive library of pre-trained models for various NLP tasks
- Well-documented and user-friendly API for easy implementation
- Active community support and frequent updates
Cons of transformers
- Focused primarily on NLP tasks, limiting its scope compared to deepmind-research
- May have higher computational requirements for some models
Code Comparison
transformers:
from transformers import pipeline
classifier = pipeline("sentiment-analysis")
result = classifier("I love this product!")[0]
print(f"Label: {result['label']}, Score: {result['score']:.4f}")
deepmind-research:
import sonnet as snt
import tensorflow as tf
model = snt.Linear(output_size=10)
x = tf.random.normal([8, 5])
y = model(x)
The transformers example demonstrates its simplicity in using pre-trained models, while the deepmind-research example showcases its flexibility in building custom neural network architectures.
OpenAI Baselines: high-quality implementations of reinforcement learning algorithms
Pros of baselines
- More focused on reinforcement learning algorithms and implementations
- Better documentation and examples for getting started quickly
- More active community contributions and updates
Cons of baselines
- Narrower scope, primarily centered on RL algorithms
- Less diverse range of research topics and applications
- Smaller codebase with fewer cutting-edge research implementations
Code Comparison
baselines (DQN implementation):
def learn(env,
network,
seed=None,
lr=5e-4,
total_timesteps=100000,
buffer_size=50000,
exploration_fraction=0.1,
exploration_final_eps=0.02,
train_freq=1,
batch_size=32,
print_freq=100,
checkpoint_freq=10000,
checkpoint_path=None,
learning_starts=1000,
gamma=1.0,
target_network_update_freq=500,
prioritized_replay=False,
prioritized_replay_alpha=0.6,
prioritized_replay_beta0=0.4,
prioritized_replay_beta_iters=None,
prioritized_replay_eps=1e-6,
param_noise=False,
callback=None,
load_path=None,
**network_kwargs
):
deepmind-research (AlphaFold protein structure prediction):
def predict_structure(
fasta_path: str,
output_dir_base: str,
data_pipeline: pipeline.DataPipeline,
model_runners: Sequence[model.RunModel],
amber_relaxer: relax.AmberRelaxation,
random_seed: int,
benchmark: bool = False,
use_precomputed_msas: bool = False,
) -> None:
Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
Pros of CNTK
- More mature and production-ready framework
- Better performance and scalability for large-scale deep learning tasks
- Extensive documentation and community support
Cons of CNTK
- Less active development and updates compared to deepmind-research
- Narrower focus on neural networks, while deepmind-research covers a broader range of AI research topics
Code Comparison
CNTK example:
import cntk as C
x = C.input_variable(2)
y = C.layers.Dense(1)(x)
z = C.sigmoid(y)
model = C.train.Trainer(z, (y, z), C.sgd(z.parameters, 0.1))
deepmind-research example (using TensorFlow):
import tensorflow as tf
x = tf.placeholder(tf.float32, shape=[None, 2])
y = tf.layers.dense(x, 1)
z = tf.sigmoid(y)
model = tf.train.GradientDescentOptimizer(0.1).minimize(z)
Note that deepmind-research is not a single framework but a collection of research projects, so the code example is just a representation using TensorFlow, which is commonly used in their projects.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
DeepMind Research
This repository contains implementations and illustrative code to accompany DeepMind publications. Along with publishing papers to accompany research conducted at DeepMind, we release open-source environments, data sets, and code to enable the broader research community to engage with our work and build upon it, with the ultimate goal of accelerating scientific progress to benefit society. For example, you can build on our implementations of the Deep Q-Network or Differential Neural Computer, or experiment in the same environments we use for our research, such as DeepMind Lab or StarCraft II.
If you enjoy building tools, environments, software libraries, and other infrastructure of the kind listed below, you can view open positions to work in related areas on our careers page.
For a full list of our publications, please see https://deepmind.com/research/publications/
Projects
- Magnetic control of tokamak plasmas through deep reinforcement learning, Nature 2022
- Pushing the Frontiers of Density Functionals by Solving the Fractional Electron Problem, Science 2021
- Mind the Gap: Assessing Temporal Generalization in Neural Language Models, NeurIPS 2021
- The Difficulty of Passive Learning in Deep Reinforcement Learning, NeurIPS 2021
- Skilful precipitation nowcasting using deep generative models of radar, Nature 2021
- Compute-Aided Design as Language
- Encoders and ensembles for continual learning
- Towards mental time travel: a hierarchical memory for reinforcement learning agents
- Perceiver IO: A General Architecture for Structured Inputs & Outputs
- Solving Mixed Integer Programs Using Neural Networks
- A Realistic Simulation Framework for Learning with Label Noise
- Rapid Task-Solving in Novel Environments, ICLR 2021
- WikiGraphs: A Wikipedia - Knowledge Graph Paired Dataset, TextGraphs 2021
- Behavior Priors for Efficient Reinforcement Learning
- Learning Mesh-Based Simulation with Graph Networks, ICLR 2021
- Open Graph Benchmark - Large-Scale Challenge (OGB-LSC)
- Synthetic Returns for Long-Term Credit Assignment
- A Deep Learning Approach for Characterizing Major Galaxy Mergers
- Better, Faster Fermionic Neural Networks (KFAC implementation)
- Object-based attention for spatio-temporal reasoning
- Effective gene expression prediction from sequence by integrating long-range interactions
- Satore: First-order logic saturation with atom rewriting
- Characterizing signal propagation to close the performance gap in unnormalized ResNets, ICLR 2021
- Uncovering the Limits of Adversarial Training against Norm-Bounded Adversarial Examples
- Learning rich touch representations through cross-modal self-supervision, CoRL 2020
- Functional Regularisation for Continual Learning, ICLR 2020
- The Autoencoding Variational Autoencoder, NeurIPS 2020
- Self-Supervised MultiModal Versatile Networks, NeurIPS 2020
- ODE-GAN: Training GANs by Solving Ordinary Differential Equations, NeurIPS 2020
- Algorithms for Causal Reasoning in Probability Trees
- Gated Linear Networks, NeurIPS 2020
- Value-driven Hindsight Modelling, NeurIPS 2020
- Targeted free energy estimation via learned mappings, Journal of Chemical Physics 2020
- Learning to Simulate Complex Physics with Graph Networks, ICML 2020
- Physically Embedded Planning Problems
- PolyGen: PolyGen: An Autoregressive Generative Model of 3D Meshes, ICML 2020
- Bootstrap Your Own Latent
- Catch & Carry: Reusable Neural Controllers for Vision-Guided Whole-Body Tasks, SIGGRAPH 2020
- MEMO: A Deep Network For Flexible Combination Of Episodic Memories, ICLR 2020
- RL Unplugged: Benchmarks for Offline Reinforcement Learning
- Disentangling by Subspace Diffusion (GEOMANCER), NeurIPS 2020
- What can I do here? A theory of affordances in reinforcement learning, ICML 2020
- Scaling data-driven robotics with reward sketching and batch reinforcement learning, RSS 2020
- Path-Specific Counterfactual Fairness, AAAI 2019
- The Option Keyboard: Combining Skills in Reinforcement Learning, NeurIPS 2019
- VISR - Fast Task Inference with Variational Intrinsic Successor Features, ICLR 2020
- Unveiling the predictive power of static structure in glassy systems, Nature Physics 2020
- Multi-Object Representation Learning with Iterative Variational Inference (IODINE)
- AlphaFold CASP13, Nature 2020
- Unrestricted Adversarial Challenge
- Hierarchical Probabilistic U-Net (HPU-Net)
- Training Language GANs from Scratch, NeurIPS 2019
- Temporal Value Transport, Nature Communications 2019
- Continual Unsupervised Representation Learning (CURL), NeurIPS 2019
- Unsupervised Learning of Object Keypoints (Transporter), NeurIPS 2019
- BigBiGAN, NeurIPS 2019
- Deep Compressed Sensing, ICML 2019
- Side Effects Penalties
- PrediNet Architecture and Relations Game Datasets
- Unsupervised Adversarial Training, NeurIPS 2019
- Graph Matching Networks for Learning the Similarity of Graph Structured Objects, ICML 2019
- REGAL: Transfer Learning for Fast Optimization of Computation Graphs
- Deep Ensembles: A Loss Landscape Perspective
- Powerpropagation
- Physics Inspired Models
Disclaimer
This is not an official Google product.
Top Related Projects
Models and examples built with TensorFlow
Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
A set of examples around pytorch in Vision, Text, Reinforcement Learning, etc.
🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
OpenAI Baselines: high-quality implementations of reinforcement learning algorithms
Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot