• Stars
    star
    222
  • Rank 179,123 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 7 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

(WIP) Implementation of Creative Adversarial Networks https://arxiv.org/pdf/1706.07068.pdf

Creative Adversarial Networks

collage

256x256 samples directly from CAN (no cherry picking) with fixed classification network trained on WikiArt

An implementation of CAN: Creative Adversarial Networks, Generating "Art" by Learning About Styles and Deviating from Style Norms with a variation that improves sample variance and quality significantly.

Repo based on DCGAN-tensorflow.

Getting the Dataset

We used the wikiart dataset available here. Using the dataset is subject to wikiart's terms of use

mkdir data
cd data
wget http://www.cs-chan.com/source/ICIP2017/wikiart.zip
unzip wikiart.zip

Getting pretrained models

We uploaded all of our models to this google drive folder

Training a CAN model from scratch (architecture used in the paper)

bash experiments/train_can_paper.sh # must run from the root directory of the project

Evaluating an existing CAN model

# make sure that load_dir acts correctly
bash experiments/eval_can_paper.sh

External Style Classification network

We ran an experiment where we trained an inception resnet to classify style (60% accuracy) and then used this for the style classification loss, removing the need to learn the layers in the discriminator. We hold the style classification network constant, so the style distribution doesn't change as the generator improves. We found that this improved the quality and diversity of our samples.

Training CAN with External Style Network

# make sure that `style_net_checkpoint` is set correctly, or you will error out
bash experiment/train_can_external_style.sh

Training the (ImageNet pre-trained) Inception Resnet

Everything you need should be included in the script. The gist is that it converts the wikiart images into tf records trains the last layer of the model on these images, then fine-tunes the entire model for 100 epochs, at the end of which you should get roughlyy 60% validation accuracy. Since we're looking to generate artwork, this gives us a level of accuracy that is sufficient to try and generate new artwork.

cd slim/
vim finetune_inception_resnet_v2_on_wikiart.sh # edit INPUT_DATASET_DIR to match the location of where you downloaded wikiart
bash finetune_inception_resnet_v2_on_wikiart.sh

Evaluating CAN with External Style Network

# make sure that `style_net_checkpoint` and `load_dir` point to the downloaded models. 
bash eval_can_external_style.sh

Experiments

We have run a variety of experiments, all of which are available in the experiments/ directory.

Authors

Phillip Kravtsov

Phillip Kuznetsov

Citation

If you use this implementation in your own work please cite the following

@misc{2017cans,
  author = {Phillip Kravtsov and Phillip Kuznetsov},
  title = {Creative Adversarial Networks},
  year = {2017},
  howpublished = {\url{https://github.com/mlberkeley/Creative-Adversarial-Networks}},
  note = {commit xxxxxxx}
}

More Repositories

1

oreilly-captions

Jupyter Notebook
155
star
2

Machine-Learning-Decal-Spring-2019

A 2-unit decal run by ML@B's education team
Jupyter Notebook
52
star
3

Machine-Learning-Decal-Fall-2018

Jupyter Notebook
44
star
4

Data-Science-Decal-Fall-2017

Jupyter Notebook
42
star
5

openbrain

Python
34
star
6

scae-pytorch

Stacked Capsule Autoencoders (SCAE) in PyTorch and their semantic interpretation
Python
31
star
7

Machine-Learning-Decal-Spring-2018

Repository for all content for Machine Learning Decal, Spring 2018.
Jupyter Notebook
29
star
8

Deep-Learning-Decal-Fall-2017

26
star
9

deepart-workshop

Making Art with Deep Learning Workshop | ML@B
Jupyter Notebook
26
star
10

deep-learning-reading-group

A public wiki for the deep learning reading group at UC Berkeley
25
star
11

blog

ML@B blog
JavaScript
23
star
12

eeg-ssl

Self-supervised learning for EEG
Python
23
star
13

Meta-Learning-Worskhop

Jupyter Notebook
16
star
14

tensorflow-bootcamp

Repo for Fall 2017 Tensorflow Bootcamp
Jupyter Notebook
13
star
15

intro-dl-workshop

Code for the Introduction to Deep Learning Workshop - Spring 2018
Jupyter Notebook
11
star
16

selfdriving-fa19

Self Driving Car Decal taught by Machine Learning @ Berkeley, fall 2019 at UC Berkeley.
Python
10
star
17

bootcamp

Bootcamp held for Spring 17.
Jupyter Notebook
10
star
18

RL-Workshop

Deep Reinforcement Learning Workshop - Spring 2018
Jupyter Notebook
10
star
19

PyTorch-Workshop

Repo for the ML@B Fall 2017 PyTorch Workshop
Jupyter Notebook
9
star
20

research-papers

Cool deep learning research papers organized by section
7
star
21

workshops

6
star
22

SqueezeDet-Pruning

Ternary Weight Pruning for SqueezeDet
Python
5
star
23

investarget

ML@B - InvesTarget
Jupyter Notebook
5
star
24

selfdriving-sp20

Jupyter Notebook
5
star
25

IntroToTensorFlow

ML@B's Intro to Tensorflow Workshop Spring 2018
Jupyter Notebook
5
star
26

fa19-NMEP

Machine Learning at Berkeley: New Member Education Program Curriculum
Jupyter Notebook
5
star
27

fa21-nmep

Fall '21 NMEP Central Repo
Jupyter Notebook
4
star
28

hyperparameter_sweeper

Automated hyperparameter sweeping.
Python
3
star
29

intro-nlp-workshop-fa18

Jupyter Notebook
3
star
30

GAN-Workshop

Workshop demo code for GANs
Jupyter Notebook
3
star
31

CUDA-intro

Example of how to use cuda
Cuda
3
star
32

indigo

TensorFlow 2 Implementation of the Transformer-InDIGO model
Python
3
star
33

NMEP-sp19

Labs, lectures, notes, homeworks for NMEP sp19
Jupyter Notebook
3
star
34

climatehack2023

Jupyter Notebook
3
star
35

rec-sys-decal-website

Website for the Recommendation Systems in Machine Learning DeCal (Fall '21)
JavaScript
2
star
36

NLP-workshop

Jupyter Notebook
2
star
37

keras_workshop

Code from Calhacks Keras workshop
Python
2
star
38

transformer-autocomplete

Python
2
star
39

calhacks-pytorch

Pytorch Workshop for Calhacks
Python
2
star
40

NNWorkshop

Repository built for a Neural Networks Workshop series!
Python
2
star
41

genetic-algs

Genetic Algorithms for Modeling Experimental Data
Python
2
star
42

slang

Jupyter Notebook
2
star
43

sap

The SAP project utilizes the HANA Vora framework for optimized database operations.
Python
2
star
44

hackathon_chatbot

CSS
1
star
45

sp20-nmep

Homework for New Member Education Program
Jupyter Notebook
1
star
46

DNA-Sequencing

Jupyter Notebook
1
star
47

beowulf

Beowulf cluster related design, script, etc.
Eagle
1
star
48

web

Ruby
1
star
49

reading-list

JavaScript
1
star
50

sp22-nmep

yeet
Python
1
star
51

mlabweb

HTML
1
star
52

h2o-redditcomments

Machine Learning at Berkeley Reddit
R
1
star
53

SP21-NMEP

Jupyter Notebook
1
star
54

tensorflow-workshop-sp17

Code for ML@B Introduction to TensorFlow Workshop
Python
1
star
55

NMEP-fa20

Jupyter Notebook
1
star
56

improve-music-rec

Improving Music Recommendation: Featurizing Audio Before Rendering It
Python
1
star
57

f18-NMEP

Homeworks, readings, and et cetera for Machine Learning at Berkeley Fall 2018 NMEP
Jupyter Notebook
1
star