# GAN-Base-on-Matlab
## Example
### example_1
* network structure:
```
generator.layers = {
struct('type', 'input', 'output_shape', [100, batch_size])
struct('type', 'fully_connect', 'output_shape', [3136, batch_size], 'activation', 'leaky_relu')
struct('type', 'reshape', 'output_shape', [7,7,64, batch_size])
struct('type', 'conv2d_transpose', 'output_shape', [14, 14, 32, batch_size], 'kernel_size', 5, 'stride', 2, 'padding', 'same', 'activation', 'leaky_relu')
struct('type', 'conv2d_transpose', 'output_shape', [28, 28, 1, batch_size], 'kernel_size', 5, 'stride', 2, 'padding', 'same', 'activation', 'sigmoid')
};
discriminator.layers = {
struct('type', 'input', 'output_shape', [28, 28, 1, batch_size])
struct('type', 'conv2d', 'output_maps', 32, 'kernel_size', 5, 'padding', 'same', 'activation', 'leaky_relu')
struct('type', 'sub_sampling', 'scale', 2)
struct('type', 'conv2d', 'output_maps', 64, 'kernel_size', 5, 'padding', 'same', 'activation', 'leaky_relu')
struct('type', 'sub_sampling', 'scale', 2)
struct('type', 'reshape', 'output_shape', [3136, batch_size])
struct('type', 'fully_connect', 'output_shape', [1, batch_size], 'activation', 'sigmoid')
};
```
* result:
<p align="center">
<img src="https://github.com/JZhaoCH/GAN-Base-on-Matlab/blob/master/readme_images/1.png">
</p>
<p align="center">
<img src="https://github.com/JZhaoCH/GAN-Base-on-Matlab/blob/master/readme_images/2.png">
</p>
### example_2
* network structure:
```
generator.layers = {
struct('type', 'input', 'output_shape', [100, batch_size])
struct('type', 'fully_connect', 'output_shape', [1024, batch_size], 'activation', 'relu')
struct('type', 'fully_connect', 'output_shape', [28*28, batch_size], 'activation', 'sigmoid')
struct('type', 'reshape', 'output_shape', [28, 28, 1, batch_size])
};
discriminator.layers = {
struct('type', 'input', 'output_shape', [28,28,1, batch_size])
struct('type', 'reshape', 'output_shape', [28*28, batch_size])
struct('type', 'fully_connect', 'output_shape', [1024, batch_size], 'activation', 'relu')
struct('type', 'fully_connect', 'output_shape', [1, batch_size], 'activation', 'sigmoid')
};
```
* result:
<p align="center">
<img src="https://github.com/JZhaoCH/GAN-Base-on-Matlab/blob/master/readme_images/3.png">
</p>
## Reference
1. `https://grzegorzgwardys.wordpress.com/2016/04/22/8/`
2. `Dumoulin V, Visin F. A guide to convolution arithmetic for deep learning[J]. 2016.`
3. `https://github.com/rasmusbergpalm/DeepLearnToolbox/tree/master/CNN`
4. `http://neuralnetworksanddeeplearning.com/index.html`
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【达摩老生出品,必属精品,亲测校正,质量保证】 资源名:matlab_GAN网络_对抗生成网络_GAN_Base_on_Matlab 资源类型:matlab项目全套源码 源码说明: 全部项目源码都是经过测试校正后百分百成功运行的,如果您下载后不能运行可联系我进行指导或者更换。 适合人群:新手及有一定经验的开发人员
资源推荐
资源详情
资源评论
收起资源包目录
matlab_GAN网络_对抗生成网络_GAN_Base_on_Matlab.zip (62个子文件)
matlab_GAN网络_对抗生成网络_GAN_Base_on_Matlab
setup_environment.m 296B
Matlab实现无约束条件下普列姆(Prim)算法.docx 14KB
test
convolution_process.m 2KB
layer
setup_fully_connect_layer.m 704B
reshape_operation.m 300B
conv2d.m 1KB
setup_conv2d_transpose_layer.m 6KB
atrous_conv2d.m 893B
sub_sample.m 346B
setup_conv2d_layer.m 2KB
conv2d_transpose.m 2KB
batch_norm.m 1KB
setup_sub_sampling_layer.m 389B
setup_batch_norm_layer.m 751B
check_layer_field_names.m 579B
setup_atrous_conv2d_layer.m 2KB
setup_reshape_layer.m 454B
readme_images
1.png 4KB
2.png 4KB
3.png 4KB
LICENSE 1KB
nerual_network_flow
nn_applygrads_sgd.m 602B
nn_ff.m 2KB
nn_setup.m 1KB
nn_bp_g.m 3KB
nn_bp_d.m 3KB
nn_applygrads_adam.m 1KB
gan_train.m 3KB
error_term
get_error_term_from_conv2d_transpose_layer.m 2KB
get_error_term_from_fully_connect_layer.m 121B
get_error_term_from_batch_norm_layer.m 1KB
get_error_term_from_conv2d_layer.m 554B
sigmoid_cross_entropy.m 284B
get_error_term_from_atrous_conv2d_layer.m 554B
get_error_term_from_sub_sampling_layer.m 374B
delta_sigmoid_cross_entropy.m 694B
get_error_term_from_reshape_layer.m 137B
activation
sigmoid.m 60B
relu.m 83B
delta_tanh.m 67B
activate_z.m 472B
delta_sigmoid.m 213B
delta_leaky_relu.m 157B
delta_activation_function.m 559B
delta_relu.m 144B
leaky_relu.m 169B
gradient
calculate_gradient_for_conv2d_transpose_layer.m 1KB
calculate_gradient_for_fully_connect_layer.m 179B
calculate_gradient_for_atrous_conv2d_layer.m 773B
calculate_gradient_for_conv2d_layer.m 739B
calculate_gradient_for_batch_norm_layer.m 731B
example_2.m 1KB
.gitignore 5B
example_1.m 2KB
README.md 3KB
util
expand.m 2KB
save_images.m 623B
padding_height_width_in_array.m 476B
argparse.m 259B
flipall.m 77B
insert_zeros_into_array.m 329B
example_3.m 1KB
共 62 条
- 1
阿里matlab建模师
- 粉丝: 4239
- 资源: 2840
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页