Skip to content

Yoctol/talos

Repository files navigation

talos

travis pypi release

About this project...

Installation

$ git clone https://github.com/Yoctol/talos.git
$ pipenv install

Usage

多個 Layers 組合串接

def pre_activate_bn_dense(units):
    return Sequential([
        Dense(
            units=units,
            kernel_initialzer='lecun_normal',
            activation=None,
        ),
        BatchNormalization(),
        Activation('relu'),
    ])

model = Sequential([
    pre_activate_bn_dense(32),
    pre_activate_bn_dense(16),
    pre_activate_bn_dense(8),
])

outputs = model(inputs)

方便的 variables/updates scope collection

with tf.control_dependencies(model.updates):
    train_op = SGDOptimizer(loss, var_list=model.trainable_variables)

Test

$ pipenv install --dev
$ pytest