Skip to content

Commit

Permalink
cod style refactor changes - part2
Browse files Browse the repository at this point in the history
  • Loading branch information
sguttikon committed Sep 23, 2022
1 parent 16a3b93 commit 391ade2
Show file tree
Hide file tree
Showing 17 changed files with 628 additions and 102 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ You can also use the [older version](https://github.com/serizba/cppflow/tree/243
## Style guide

We use the [Google's C++ style guide](https://google.github.io/styleguide/cppguide.html) using static code linker [cpplint](https://github.com/cpplint/cpplint).
We use the [Google's Python style guide](https://google.github.io/styleguide/pyguide.html) using static code linker [pylint](https://pylint.pycqa.org/en/latest/user_guide/installation/index.html) using attached pylintrc configuration.


## Remark

Expand Down
2 changes: 0 additions & 2 deletions examples/eager_op_multithread/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

/*!
* @file main.cpp
* @brief A brief description here.
* @details Define custom details for the file here.
* @author Jiannan Liu
* @author Sergio Izquierdo
* @date @showdate "%B %d, %Y" 2020-10-26
Expand Down
15 changes: 7 additions & 8 deletions examples/efficientnet/create_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env python
"""
Example for create model functionality.
"""

# MIT License
#
Expand All @@ -22,14 +25,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# @file create_model.py
#
# @brief A brief description here.
#
# @section description_create_model Define custom details for the file here.
#
# @section author_create_model Author(s)
# - Created by Sergio Izquierdo
##
# @file create_model.py
# @author Sergio Izquierdo
# @date @showdate "%B %d, %Y" 2020-09-16

# Imports
import tensorflow as tf
Expand Down
2 changes: 0 additions & 2 deletions examples/efficientnet/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

/*!
* @file main.cpp
* @brief A brief description here.
* @details Define custom details for the file here.
* @author Florian
* @author Sergio Izquierdo
* @date @showdate "%B %d, %Y" 2020-09-16
Expand Down
27 changes: 13 additions & 14 deletions examples/load_frozen_graph/create_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env python
"""
Example for a load frozen tf graph functionality.
"""

# MIT License
#
Expand All @@ -24,27 +27,23 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# @file create_model.py
#
# @brief A brief description here.
#
# @section description_create_model Define custom details for the file here.
#
# @section author_create_model Author(s)
# - Created by Daisuke Kato
# - Created by Paul
# - Modified by Sergio Izquierdo
##
# @file create_model.py
# @author Daisuke Kato
# @author Paul
# @author Sergio Izquierdo
# @date @showdate "%B %d, %Y" 2021-09-16

# Imports
import tensorflow as tf
from tensorflow.python.framework.convert_to_constants import (
convert_variables_to_constants_v2,
)

input = tf.keras.Input(shape=(5,))
output = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input)
output = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid)(output)
model = tf.keras.Model(inputs=input, outputs=output)
input_1 = tf.keras.Input(shape=(5,))
output_1 = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input_1)
output_1 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid)(output_1)
model = tf.keras.Model(inputs=input_1, outputs=output_1)

# Create frozen graph
x = tf.TensorSpec(model.input_shape, tf.float32, name="x")
Expand Down
2 changes: 0 additions & 2 deletions examples/load_frozen_graph/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

/*!
* @file main.cpp
* @brief A brief description here.
* @details Define custom details for the file here.
* @author Daisuke Kato
* @author Paul
* @author Sergio Izquierdo
Expand Down
24 changes: 11 additions & 13 deletions examples/load_model/create_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env python
"""
Example for a load model functionality.
"""

# MIT License
#
Expand All @@ -22,24 +25,19 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# @file create_model.py
#
# @brief A brief description here.
#
# @section description_create_model Define custom details for the file here.
#
# @section author_create_model Author(s)
# - Created by Sergio Izquierdo
##
# @file create_model.py
# @author Sergio Izquierdo
# @date @showdate "%B %d, %Y" 2019-05-16

# Imports
import tensorflow as tf
import numpy as np

input = tf.keras.Input(shape=(5,))
input_1 = tf.keras.Input(shape=(5,))

output = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input)
output = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid)(output)
model = tf.keras.Model(inputs=input, outputs=output)
output_1 = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input_1)
output_1 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid)(output_1)
model = tf.keras.Model(inputs=input_1, outputs=output_1)

model.compile()

Expand Down
2 changes: 0 additions & 2 deletions examples/load_model/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

/*!
* @file main.cpp
* @brief A brief description here.
* @details Define custom details for the file here.
* @author Afaq Sabir
* @author Florian
* @author Paul Nykiel
Expand Down
22 changes: 11 additions & 11 deletions examples/multi_input_output/create_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env python
"""
Example for a multiple inputs and outputs functionality.
"""

# MIT License
#
Expand All @@ -22,27 +25,24 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# @file create_model.py
#
# @brief A brief description here.
#
# @section description_create_model Define custom details for the file here.
#
# @section author_create_model Author(s)
# - Created by Sergio Izquierdo
##
# @file create_model.py
# @author Sergio Izquierdo
# @date @showdate "%B %d, %Y" 2020-10-20

# Imports
import tensorflow as tf
import numpy as np

input_1 = tf.keras.Input(shape=(5,), name='my_input_1')
input_2 = tf.keras.Input(shape=(5,), name='my_input_2')

x1 = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input_1)
x2 = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input_2)

output_1 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid, name='my_outputs_1')(x1)
output_2 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid, name='my_outputs_2')(x2)
output_1 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid,
name='my_outputs_1')(x1)
output_2 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid,
name='my_outputs_2')(x2)

model = tf.keras.Model(inputs=[input_1, input_2], outputs=[output_1, output_2])

Expand Down
2 changes: 0 additions & 2 deletions examples/multi_input_output/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

/*!
* @file main.cpp
* @brief A brief description here.
* @details Define custom details for the file here.
* @author Florian
* @author Sergio Izquierdo
* @date @showdate "%B %d, %Y" 2020-10-15
Expand Down
2 changes: 0 additions & 2 deletions examples/tensor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

/*!
* @file main.cpp
* @brief A brief description here.
* @details Define custom details for the file here.
* @author Jiannan Liu
* @author Seungtaek Kim
* @author Sergio Izquierdo
Expand Down
2 changes: 0 additions & 2 deletions examples/tensor/odr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

/*!
* @file odr.cpp
* @brief A brief description here.
* @details Define custom details for the file here.
* @author Jiannan Liu
* @author Sergio Izquierdo
* @date @showdate "%B %d, %Y" 2020-10-26
Expand Down
2 changes: 1 addition & 1 deletion include/cppflow/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// SOFTWARE.

/*!
* @file cppflow.h
* @file model.h
* @author Jiannan Liu
* @author liufeng27
* @author Paul
Expand Down
2 changes: 1 addition & 1 deletion include/cppflow/ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// SOFTWARE.

/*!
* @file context.h
* @file ops.h
* @author Jiannan Liu
* @author Sergio Izquierdo
* @date @showdate "%B %d, %Y" 2020-07-31
Expand Down
Loading

0 comments on commit 391ade2

Please sign in to comment.