Skip to content

Instantly share code, notes, and snippets.

View truongthanhdat's full-sized avatar
🎯
Focusing

Thanh-Dat Truong truongthanhdat

🎯
Focusing
View GitHub Profile
@truongthanhdat
truongthanhdat / mlp.py
Created October 3, 2020 03:09
Multi Linear Perceptron
import torch
import random
import numpy as np
import time
from tqdm import tqdm
import matplotlib.pyplot as plt
class Dataset(torch.utils.data.Dataset):
def __init__(self, N = 1000, o = (0, 0), r = 1, balance = True):

Generative Discriminative Networks - GANs

GANs là gì?

GANs là một thuật toán học không giám sát (Unsupersived Learning) được Ian Goodfellow �giới thiệu vào năm 2014 tại hội nghị NIPS, trong đó bao gồm hai thành phần chính là GeneratorDiscriminator:

  • Generator (ký hiệu $G$) nhận nhiệm vụ học ra cách áp xạ từ một không gian tìm ẩn $Z$ (a latent space) vào một không gian với phân phối từ dữ liệu �cho trước.

  • Discriminator (ký hiệu $D$) nhận nhiệm vụ phân biệt dữ liệu được tạo ra từ $G$ và dữ liệu cho trước.

@truongthanhdat
truongthanhdat / mnist_gan_tutorial.py
Last active March 23, 2020 09:03
MNIST GAN Tutorial
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
def generator(inputs):
with tf.variable_scope("generator"):
net = slim.fully_connected(inputs, 256, scope = "fc1")
net = slim.fully_connected(net, 784, scope = "fake_images", activation_fn = tf.nn.sigmoid)
return net