项目作者: kristpapadopoulos

项目描述 :
Utility for extracting layer weights and biases from Keras models
高级语言: Python
项目地址: git://github.com/kristpapadopoulos/keras-extract-weights.git
创建时间: 2018-05-05T04:27:13Z
项目社区:https://github.com/kristpapadopoulos/keras-extract-weights

开源协议:

下载


Keras extract weights from model to python dictionary

The file extract_parameters.py

  • takes Keras h5py model parameter file and outputs a python dictionary with option to output as pickle file
  • extract_parameters.py —h5_path=’file_path’ —output_path=’file_path’

Tested with:

  1. h5py 3.1.0

Each Keras layer has a group that has members: 1 for the biases and 1 for the parameters of the layer.


Example

Output for 3 layer neural network - see dataset folder for input file.