Tensorflow 2.0 implementation of Sinusodial Representation networks (SIREN).
Project description
Tensorflow Sinusodial Representation Networks (SIREN)
Tensorflow 2.0 implementation of Sinusodial Representation networks (SIREN) from the paper Implicit Neural Representations with Periodic Activation Functions.
Usage
Copy the tf_siren
folder to your local directory and import either SinusodialRepresentationDense
or SIRENModel
.
from tf_siren.siren import SinusodialRepresentationDense
from tf_siren.siren_mlp import SIRENModel
# You can use SinusodialRepresentationDense exactly like you ordinarily use Dense layers.
ip = tf.keras.layers.Input(shape=[2])
x = SinusodialRepresentationDense(32,
activation='sine', # default activation function
w0=1.0)(ip) # w0 represents sin(w0 * x) where x is the input.
model = tf.keras.Model(inputs=ip, outputs=x)
# Or directly use the model class to build a multi layer SIREN
model = SIRENModel(units=256, final_units=3, final_activation='sigmoid',
num_layers=5, w0=1.0, w0_initial=30.0)
Results on Image Inpainting task
A partial implementation of the image inpainting task is available as the train_inpainting_siren.py
and eval_inpainting_siren.py
scripts inside the scripts
directory.
Weight files are made available in the repository under the Release
tab of the project. Extract the weights and place the checkpoints
folder at the root of the project directory.
These weights generates the following output after 5000 epochs of training with batch size 8192 while using only 10% of the available pixels in the image during training phase.
Requirements
Tensorflow 2.0+ Matplotlib to visualize eval result
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tf_siren-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc3dc6e0e2fb26cb46cf0a6038bbae3e91622f03cad3f8ae46262fd8f20d5d44 |
|
MD5 | f44db4ca4c5198424817bc17ced52e94 |
|
BLAKE2b-256 | d57420d82a35c36f59f5419888158de280a5038a0c9652f374337ea2b56e920d |