Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Simple Tensorflow Cookbook for easy-to-use
| Date | Stars |
|---|---|
| 2026-07-24 | 2745 |
| 2026-07-25 | 2745 |
| 2026-07-28 | 2745 |
| 2026-07-30 | 2745 |
| 2026-08-06 | 2745 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
<div align="center">
<img src="./assets/tf-cook.png" height = '300px'>
</div>
# [Web page](http://bit.ly/jhkim_tf_cookbook)
# [Tensorflow 2 Cookbook](https://github.com/taki0112/Tensorflow2-Cookbook)
## Contributions
In now, this repo contains general architectures and functions that are useful for the GAN and classificstion.
I will continue to add useful things to other areas.
Also, your pull requests and issues are always welcome.
And write what you want to implement on the issue. I'll implement it.
# How to use
## Import
* `ops.py`
* **operations**
* from ops import *
* `utils.py`
* **image processing**
* from utils import *
## Network template
```python
def network(x, is_training=True, reuse=False, scope="network"):
with tf.variable_scope(scope, reuse=reuse):
x = conv(...)
...
return logit
```
## Insert data to network using DatasetAPI
```python
Image_Data_Class = ImageData(img_size, img_ch, augment_flag)
trainA_dataset = ['./dataset/cat/trainA/a.jpg',
'./dataset/cat/trainA/b.png',
'./dataset/cat/trainA/c.jpeg',
...]
trainA = tf.data.Dataset.from_tensor_slices(trainA_dataset)
trainA = trainA.map(Image_Data_Class.image_processing, num_parallel_calls=16)
trainA = trainA.shuffle(buffer_size=10000).prefetch(buffer_size=batch_size).batch(batch_size).repeat()
trainA_iterator = trainA.make_one_shot_iterator()
data_A = trainA_iterator.get_next()
logit = network(data_A)
```
* See [this](https://github.com/taki0112/Tensorflow-DatasetAPI) for more information.
## Option
* `padding='SAME'`
* pad = ceil[ (kernel - stride) / 2 ]
* `pad_type`
* 'zero' or 'reflect'
* `sn`
* use [spectral_normalization](https://arxiv.org/pdf/1802.05957.pdf) or not
## Caution
* If you don't want to share variable, **set all scope names differently.**
---
## Weight
```python
weight_init = tf.truncated_normal_initializer(mean=0.0, stddev=0.02)
weight_regularizer = tf.contrib.layers.l2_regularizer(0.0001)
weight_regularizer_fully = tf.contrib.layers.l2_regularizer(0.0001)
```
### Initialization
* `Xavier` : tf.contrib.layers.xavier_initializer()
```python
USE """tf.contrib.layers.variance_scaling_initializer()"""
if uniform :
factor = gain * gain
mode = 'FAN_AVG'
else :
factor = (gain * gain) / 1.3
mode = 'FAN_AVG'
```
* `He` : tf.contrib.layers.variance_scaling_initializer()
```python
if uniform :
factor = gain * gain
mode = 'FAN_IN'
else :
factor = (gain * gain) / 1.3
mode = 'FAN_OUT'
```
* `Normal` : tf.random_normal_initializer(mean=0.0, stddev=0.02)
* `Truncated_normal` : tf.truncated_normal_initializer(mean=0.0, stddev=0.02)
* `Orthogonal` : tf.orthogonal_initializer(1.0) / # if relu = sqrt(2), the others = 1.0
### Regularization
* `l2_decay` : tf.contrib.layers.l2_regularizer(0.0001)
* `orthogonal_regularizer` : orthogonal_regularizer(0.0001) & orthogonal_regularizer_fully(0.0001)
## Convolution
### basic conv
```python
x = conv(x, channels=64, kernel=3, stride=2, pad=1, pad_type='reflect', use_bias=True, sn=True, scope='conv')
```
<div align="center">
<img src="https://github.com/vdumoulin/conv_arithmetic/raw/master/gif/padding_strides.gif" width = '300px'>
</div>
### partial conv (NVIDIA [Partial Convolution](https://github.com/NVIDIA/partialconv))
```python
x = partial_conv(x, channels=64, kernel=3, stride=2, use_bias=True, padding='SAME', sn=True, scope='partial_conv')
```


### dilated conv
```python
x = dilate_conv(x, channels=64, kernel=3, rate=2, use_bias=True, padding='VALID', sn=True, scope='dilate_conv')
```
<div align="center">
<img src="https://github.com/vdumoulin/conv_arithmetic/raw/master/gif/dilation.gif" width = '300Excerpt of 11,030 characters
Read on GitHubJunho Kim · NAVER AI Lab · South Korea
110
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:e0eb37962cc9490f, topic:tensorflow