资源简介
vgg模型在复数域的代码,参照deep complex network论文中在残差网络上的改进,基于keras
代码片段和文件信息
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Authors: Chiheb Trabelsi Olexa Bilaniuk
#
# Note: The implementation of complex Batchnorm is based on
# the Keras implementation of batch Normalization
# available here:
# https://github.com/fchollet/keras/blob/master/keras/layers/normalization.py
import numpy as np
from keras.layers import layer InputSpec
from keras import initializers regularizers constraints
import keras.backend as K
def sqrt_init(shape dtype=None):
value = (1 / K.sqrt(2)) * K.ones(shape)
return value
def sanitizedInitGet(init):
if init in [“sqrt_init“]:
return sqrt_init
else:
return initializers.get(init)
def sanitizedInitSer(init):
if init in [sqrt_init]:
return “sqrt_init“
else:
return initializers.serialize(init)
def complex_standardization(input_centred Vrr Vii Vri
layernorm=False axis=-1):
ndim = K.ndim(input_centred)
input_dim = K.shape(input_centred)[axis] // 2
variances_broadcast = [1] * ndim
variances_broadcast[axis] = input_dim
if layernorm:
variances_broadcast[0] = K.shape(input_centred)[0]
# We require the covariance matrix‘s inverse square root. That first requires
# square rooting followed by inversion (I do this in that order because during
# the computation of square root we compute the determinant we‘ll need for
# inversion as well).
# tau = Vrr + Vii = Trace. Guaranteed >= 0 because SPD
tau = Vrr + Vii
# delta = (Vrr * Vii) - (Vri ** 2) = Determinant. Guaranteed >= 0 because SPD
delta = (Vrr * Vii) - (Vri ** 2)
s = np.sqrt(delta) # Determinant of square root matrix
t = np.sqrt(tau + 2 * s)
# The square root matrix could now be explicitly formed as
# [ Vrr+s Vri ]
# (1/t) [ Vir Vii+s ]
# https://en.wikipedia.org/wiki/Square_root_of_a_2_by_2_matrix
# but we don‘t need to do this immediately since we can also simultaneously
# invert. We can do this because we‘ve already computed the determinant of
# the square root matrix and can thus invert it using the analytical
# solution for 2x2 matrices
# [ A B ] [ D -B ]
# inv( [ C D ] ) = (1/det) [ -C A ]
# http://mathworld.wolfram.com/MatrixInverse.html
# Thus giving us
# [ Vii+s -Vri ]
# (1/s)(1/t)[ -Vir Vrr+s ]
# So we proceed as follows:
inverse_st = 1.0 / (s * t)
Wrr = (Vii + s) * inverse_st
Wii = (Vrr + s) * inverse_st
Wri = -Vri * inverse_st
# And we have computed the inverse square root matrix W = sqrt(V)!
# Normalization. We multiply x_normalized = W.x.
# The returned result will be a complex standardized input
# where the real and imaginary parts are obtained as follows:
# x_real_normed = Wrr * x_real_centred + Wri * x_imag_centred
# x_imag_normed = Wri * x_real_centred + Wii * x_imag_centred
broadcast_Wrr = K
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 21518 2018-01-18 14:57 vgg19_retrain\complexnn\bn.py
文件 43080 2018-01-26 17:08 vgg19_retrain\complexnn\conv.py
文件 9107 2018-01-18 14:57 vgg19_retrain\complexnn\dense.py
文件 5588 2018-01-26 15:12 vgg19_retrain\complexnn\fft.py
文件 10779 2018-01-18 14:57 vgg19_retrain\complexnn\init.py
文件 11239 2018-01-26 15:04 vgg19_retrain\complexnn\norm.py
文件 4876 2018-01-18 14:57 vgg19_retrain\complexnn\pool.py
文件 2186 2018-01-18 14:57 vgg19_retrain\complexnn\utils.py
文件 861 2018-01-18 14:57 vgg19_retrain\complexnn\__init__.py
文件 11139 2018-01-26 11:50 vgg19_retrain\complexnn\__pycache__\bn.cpython-36.pyc
文件 31498 2018-01-26 17:08 vgg19_retrain\complexnn\__pycache__\conv.cpython-36.pyc
文件 6604 2018-01-26 15:05 vgg19_retrain\complexnn\__pycache__\dense.cpython-36.pyc
文件 5682 2018-01-26 15:14 vgg19_retrain\complexnn\__pycache__\fft.cpython-36.pyc
文件 5963 2018-01-26 15:04 vgg19_retrain\complexnn\__pycache__\init.cpython-36.pyc
文件 6497 2018-01-26 15:05 vgg19_retrain\complexnn\__pycache__\norm.cpython-36.pyc
文件 4448 2018-01-26 15:14 vgg19_retrain\complexnn\__pycache__\pool.cpython-36.pyc
文件 2750 2018-01-26 15:18 vgg19_retrain\complexnn\__pycache__\utils.cpython-36.pyc
文件 1002 2018-01-25 15:44 vgg19_retrain\complexnn\__pycache__\__init__.cpython-36.pyc
文件 11592 2018-02-28 15:53 vgg19_retrain\sc
文件 4132109 2018-01-20 12:41 vgg19_retrain\vgg19_retrain_logs\events.out.tfevents.1516423255.DESKTOP-DJOM3UF
目录 0 2018-01-26 17:08 vgg19_retrain\complexnn\__pycache__
目录 0 2018-01-26 15:04 vgg19_retrain\complexnn
目录 0 2018-01-26 15:40 vgg19_retrain\sc
目录 0 2018-01-20 12:40 vgg19_retrain\vgg19_retrain_logs
目录 0 2018-01-26 14:44 vgg19_retrain
----------- --------- ---------- ----- ----
4328518 25
- 上一篇:LabVIEW实现Fuzzy_PID的补充资源
- 下一篇:顺序表的基本算法(实验)
相关资源
- fpga四路视频图像VGA显示
- 基于概率神经网络的图匹配算法研究
- 基于Nexys4 ddr开发板的VGA测试程序
- 基于神经网络的身份证号码识别算法
- 机器学习方法R实现-用决策树、神经网
- 基于神经网络及Logistic回归的混合信用
- 台湾大学李宏毅——超详细GAN对抗神
- 神经网络原理 Simon.Haykin 编——神经网
- 基于主成分分析与BP神经网络的雾天能
- 卷积神经网络的压缩和加速
- 脉冲耦合神经网络工具箱PCNN-toolbox
- 神经网络(一些算法论文)可以学习
- 全国各省市svg地图
- 基于深度学习的图像超分辨率算法论
- 基于DE2开发板的VGA显示模块,仅供大
- 基于BP神经网络的挖掘机液压系统故障
- 基于采样控制的时滞神经网络的指数
- 时间序列和神经网络对迷你型洗衣机
- 论文研究 - 基于EMD和BP_AdaBoost神经网络
- RT1052野火基于 RT-Thread 移植的littlevg
- 脉冲耦合神经网络
- 人工智能初步学习总结
- 论文研究 - 基于协同过滤和人工神经
- 基于粒子群算法优化RBF神经网络的异
- 基于GIS和人工神经网络的井下无线传
- 迁移学习简明手册
- 论文研究 - 量子神经网络的分布强化
- BP神经网络在手机评价中的应用
- 基于因素分析与BP神经网络的上市公司
- 卷积神经网络的人脸识别样本采集+
评论
共有 条评论