chenfei-wu/Relation-Network-Tensorflow — an open-source project — sits at 1 GitHub stars. Tensorflow implementations of Relational Networks and a VQA dataset named Sort-of-CLEVR proposed by DeepMind.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
As part of the implementation series of Joseph Lim's group at USC, our motivation is to accelerate (or sometimes delay) research in the AI community by promoting open-source projects. To this end, we implement state-of-the-art research papers, and publicly share them with concise reports. Please visit our group github site for other projects.
This project is implemented by Shao-Hua Sun and reviewed by Youngwoon Lee.
Descriptions
This project includes a Tensorflow implementation of Relation Networks and a dataset generator which generates a synthetic VQA dataset named Sort-of-CLEVR proposed in the paper A Simple Neural Network Module for Relational Reasoning.
Relation Networks
Relational reasoning is an essential component of intelligent systems. To this end, Relation Networks (RNs) are proposed to solve problems hinging on inherently relational concepts. To be more specific, RN is a composite function:
,
where o represents inidividual object while f and g are functions dealing with relational reasoning which are implemented as MLPs. Note that objects mentioned here are not necessary to be real objects; instead, they could consist of the background, particular physical objects, textures, conjunctions of physical objects, etc. In the implementation, objects are defined by convoluted features. The model architecture proposed to solve Visual Question Answering (VQA) problems is as follows.
In addition to the RN model, a baseline model which consists of convolutional layers followed by MLPs is also provided in this implementation.
Sort-of-CLEVR
To verify the effectiveness of RNs, a synthesized VQA dataset is proposed in the paper named Sort-of-CLEVR. The dataset consists of paired questions and answers as well as images containing colorful shapes.
Each image has a number of shapes (rectangle or circle) which have different colors (red, blue, green, yellow, cyan, or magenta). Here are some examples of images.
Questions are separated into relational and non-relational questions which are encoded as binary strings to prevent the effect of language parsing and embedding; while answers are represented as one-hot vectors. Examples of images, questions and answers are as follow.
Given a queried color, all the possible questions are as follows.
Non-relational questions
Is it a circle or a rectangle?
Is it closer to the bottom of the image?
Is it on the left of the image?
Relational questions
The color of the nearest object?
The color of the farthest object?
And the possible answer is a fixed length one-hot vector whose elements represent
Generated files use HDF5 file format. Each data point contains an image, an one-hot vector q encoding a question, and an one-hot vector a encoding the corresponding answer.
Note that this implementation only follows the main idea of the original paper while differing a lot in implementation details such as model architectures, hyperparameters, applied optimizer, etc. Also, the design of Sort-of-CLEVR only follows the high-level ideas of the one proposed in the orginal paper.
*This code is still being developed and subject to change.
Prerequisites
Python 2.7 or Python 3.3+
Tensorflow 1.0.0
NumPy
PIL
matplotlib
h5py
progressbar
colorlog
Usage
Datasets
Generate a default Sort-of-CLEVR dataset:
$ python generator.py
Or generate your own Sort-of-CLEVR dataset by specifying args:
Or you can even change the number of shape presented in the images, the number of possible colors, types of questions and answers by configuring the file vqa_util.py.
Training
Train a RN model with a default Sort-of-CLEVR dataset:
During the training phase, the samples including images, questions, ground truth answers, and predicted answers can be monitored on Tensorboard if the library Tensorflow Plot is installed. Here is an example.
Testing
Test a trained model by specifying the dataset and the model used for training and a checkpoint:
How active is development on chenfei-wu/Relation-Network-Tensorflow?
The most recent commit recorded on chenfei-wu/Relation-Network-Tensorflow was 9.4 years ago, based on the GitHub push timestamp. The repository has 0 forks — one of the better signals of community interest.
How many stars does chenfei-wu/Relation-Network-Tensorflow have?
chenfei-wu/Relation-Network-Tensorflow has 1 GitHub stars — refresh the page for the live number, or check github.com/chenfei-wu/Relation-Network-Tensorflow. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is chenfei-wu/Relation-Network-Tensorflow open source?
Yes — chenfei-wu/Relation-Network-Tensorflow ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/chenfei-wu/Relation-Network-Tensorflow.
What is chenfei-wu/Relation-Network-Tensorflow?
chenfei-wu/Relation-Network-Tensorflow (chenfei-wu/Relation-Network-Tensorflow) is a Python project on GitHub. From the project's own README: Tensorflow implementations of Relational Networks and a VQA dataset named Sort-of-CLEVR proposed by DeepMind.
What language is chenfei-wu/Relation-Network-Tensorflow written in?
chenfei-wu/Relation-Network-Tensorflow is written primarily in Python. GitHub's language field is based on the largest share of bytes in the default branch.
What license does chenfei-wu/Relation-Network-Tensorflow use?
chenfei-wu/Relation-Network-Tensorflow is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about chenfei-wu/Relation-Network-Tensorflow?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/chenfei-wu/Relation-Network-Tensorflow is the definitive source.
Read full README in the tab above.
Curious whether Relation-Network-Tensorflow is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about Relation-Network-Tensorflow.