kristpapadopoulos / keras-extract-weights

Utility for extracting layer weights and biases from Keras models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

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.

About

Utility for extracting layer weights and biases from Keras models


Languages

Language:Python 100.0%