explaingit

princewen/tensorflow_practice

7,006PythonAudience · researcherComplexity · 3/5Setup · moderate

TLDR

A hands-on collection of TensorFlow code examples in Python covering neural networks, NLP, reinforcement learning, recommendation systems, and generative models, with companion articles in Chinese.

Mindmap

mindmap
  root((TF Practice))
    Basics
      TensorBoard
      Save and load
      Convolutional nets
    NLP
      RNN and LSTM
      Seq2Seq
      Chatbot
    Reinforcement Learning
      DQN variants
      Policy Gradient
      Actor Critic
    Recommendations
      DeepFM
      DIN and NCF
    Generative Models
      Basic GAN
      SeqGAN
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Study working TensorFlow code for RNNs, LSTMs, and sequence-to-sequence models while learning the framework.

USE CASE 2

Explore reinforcement learning algorithms like DQN, Policy Gradient, and Actor-Critic with runnable examples.

USE CASE 3

Implement recommendation models like DeepFM, DIN, or NCF using code close to production patterns.

USE CASE 4

Experiment with GAN training using the included basic GAN and SeqGAN examples.

Tech stack

PythonTensorFlow

Getting it running

Difficulty · moderate Time to first run · 1h+

Built against TensorFlow 1.4, datasets must be downloaded separately from Baidu Pan.

In plain English

This repository is a collection of TensorFlow practice examples written in Python, covering several areas of machine learning. TensorFlow is a framework for building and training machine learning models, and this repo provides working code for a range of techniques so someone learning the subject can study real implementations alongside the theory. The README and companion articles are in Chinese. The code is organized into five main sections. The first covers TensorFlow basics: syntax, visualizing model structure with TensorBoard, saving and loading trained models, and building simple neural networks and convolutional networks. These are entry-level examples intended for people just starting with the framework. The second section focuses on natural language processing. It includes examples of recurrent neural networks (RNNs) in both static and dynamic forms, LSTM networks for sequence tasks, and a sequence-to-sequence model with an attention mechanism used to build a simple chatbot. The third section covers reinforcement learning, which is a way of training an agent to make decisions by rewarding correct actions. The examples work through a progression of algorithms: Q-learning, SARSA, DQN and its three major variants (Double DQN, Dueling DQN, and Prioritized Replay DQN), Policy Gradient, Actor-Critic, DDPG, and MADDPG for multi-agent settings. There is also an example of a Pointer Network, which is a neural architecture used for combinatorial optimization problems. The fourth section focuses on recommendation systems, which are the kind of algorithms used to suggest products, articles, or videos to users. It includes implementations of many models commonly used in industry, including FM, FFM, DeepFM, Deep Cross Network, PNN, NFM, AFM, DIN, NCF, and others. There are also examples of evaluation metrics used to measure how well recommendation models perform. The fifth section has two generative adversarial network examples: a basic GAN and SeqGAN, which applies adversarial training to sequence generation tasks. The project was built against TensorFlow 1.4 and links to a Baidu Pan download for the datasets used in the examples.

Copy-paste prompts

Prompt 1
I'm learning TensorFlow and want to understand how LSTMs work for sequence tasks, walk me through the LSTM example in this tensorflow_practice repo.
Prompt 2
Show me how to adapt the DQN implementation in tensorflow_practice to train an agent on a custom environment.
Prompt 3
I want to build a recommendation system using DeepFM, how does the implementation in this repo work and what does each layer do?
Prompt 4
Explain the sequence-to-sequence chatbot example in tensorflow_practice, how does the attention mechanism improve the model?
Open on GitHub → Explain another repo

← princewen on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.