资源简介
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的补充资源
- 下一篇:顺序表的基本算法(实验)
相关资源
- CNN-SVM模型在抽油机井故障诊断中的应
- bp神经网络源代码,可直接运行
- 连续hopfield神经网络解决TSP问题
- 改进的BP神经网络算法
- 基于bp神经网络的表情识别
- 神经网络仿真工具源代码
- 液晶显示器VGA视频接口及显示规范
- 使用卷积神经网络在e + e-对撞机上改
- LvglFontTool_V0.4.rar
- 基于VGA的Flappy Bird的Verilog实现(源码
- 用labview编写的一个神经网络Vi图
- TMEIC TMdrive-MVGC 高压变频器手册.pdf
- AVG最新有效激活码
- 基于改进的SOM神经网络在产品配置中
- 一种高压防爆SVG用水冷却装置的设计
- 深度学习卷积神经网络可检测和分类
- 如何在CANVAS中使用D3.JS
- 标量场理论的回归和生成神经网络
- 基于熵权法的PHC管桩承载力组合预测
- 基于ARIMA、BP神经网络与GM的组合模型
- 车辆自适应神经网络编队控制
- 基于RBF神经网络在线辨识的永磁同步
- 基于BP人工神经网络的SmFeN永磁材料工
- 融合粗糙集和人工神经网络的产品敏
- 基于粗糙集神经网络的数据挖掘在门
- Google OCR API源代码和神经网络识别OC
- 信息融合、神经网络-模糊推理理论及
- 基于双隐含层BP神经网络的预测
- SOM神经网络 PPT
- 小波神经网络预测模型代码
评论
共有 条评论