Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hkvision committed Dec 11, 2017
1 parent a03ed1a commit eaa2d79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/docs/APIGuide/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Saved weights in __HDF5__ file can also be loaded together with the architecture

You can directly use the API `load_keras` to load the Keras model into BigDL.

__Remark__: `tensorflow`, `keras==1.2.2` and `h5py` need to be installed beforehand. They can be installed via `pip` easily.
__Remark__: Packages `tensorflow`, `keras==1.2.2` and `h5py` are required. They can be installed via `pip` easily.

```python
from bigdl.nn.layer import *
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/ProgrammingGuide/keras-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ BigDL supports loading pre-defined Keras models and running the models in a dist

The Keras version we support and test is [__Keras 1.2.2__](https://faroit.github.io/keras-docs/1.2.2/).

## **Loading a Keras model into BigDL**
## **Load a Keras model into BigDL**

A Keras model definition in __JSON__ file can be loaded as a BigDL model.
Saved weights in __HDF5__ file can also be loaded together with the architecture of a model.
See [here](https://faroit.github.io/keras-docs/1.2.2/getting-started/faq/#how-can-i-save-a-keras-model) on how to save the architecture and weights of a Keras model.

You can directly use the API `load_keras` to load the Keras model into BigDL.

__Remark__: `tensorflow`, `keras==1.2.2` and `h5py` need to be installed beforehand. They can be installed via `pip` easily.
__Remark__: Packages `tensorflow`, `keras==1.2.2` and `h5py` are required. They can be installed via `pip` easily.

```python
from bigdl.nn.layer import *
Expand All @@ -23,7 +23,7 @@ Parameters:

* `def_path` The JSON file path containing the keras model definition to be loaded.
* `weights_path` The HDF5 file path containing the pre-trained keras model weights. Default to be `None` if you choose not to load weights. In this case, initialized weights will be used for the model.
* `by_name` Whether to load the weights of layers by name. Use this option only when you do load the pre-trained weights. Default to be `False`, meaning that weights are loaded based on the network's execution order topology. Otherwise, only those layers with the same name will be loaded with weights.
* `by_name` Whether to load the weights of layers by name. Use this option only when you load the pre-trained weights. Default to be `False`, meaning that weights are loaded based on the network's execution order topology. Otherwise, if it is set to be `True`, only those layers with the same name will be loaded with weights.

## **Example**

Expand Down Expand Up @@ -100,9 +100,9 @@ optimizer.set_validation(
optimizer.optimize()
```

### **Limitation**
### **Limitations**
We have tested the model loading functionality with some standard [Keras applications](https://faroit.github.io/keras-docs/1.2.2/applications/) and [examples](https://github.com/fchollet/keras/tree/1.2.2/examples).

There still exist some arguments for Keras layers that are not supported in BigDL for now. We haven't supported self-defined Keras layers, but one can still define your customized layer converter and weight converter method for new layers.
There still exist some arguments for Keras layers that are not supported in BigDL for now. We haven't supported self-defined Keras layers, but one can still define your customized layer converter and weight converter method for new layers if you wish.

In our future work, we will continue add functionality and better support running Keras on BigDL.

0 comments on commit eaa2d79

Please sign in to comment.