Metadata-Version: 2.1
Name: neuralfilter
Version: 0.1.6
Summary: neural attention filter
Home-page: UNKNOWN
Author: YeongHyeon Park
Author-email: young200405@gmail.com
License: UNKNOWN
Keywords: neural-filter
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: tensorflow

Neural Filter
=====

## Functions
#### neuralfilter.generate(x, force=False)
- <strong>x</strong>: Array with resolution $(H, W, C)$  
The dimension $C$ is recommended as 1.  
- <strong>force</strong>: If you want to force this operation when the dimension $C$ is higher than 1,  set 'force' as True.  

#### neuralfilter.batch_generate(x, force=False)
- The batch processing mode of '<a href='https://github.com/YeongHyeon/NeuralFilter#neuralfiltergeneratex-forcefalse'>generate</a>'.  
- <strong>x</strong>: Array with resolution $(N, H, W, C)$  
The dimension $C$ is recommended as 1.  
- <strong>force</strong>: If you want to force this operation when the dimension $C$ is higher than 1,  set 'force' as True.  

batch_generate(x, force=False)



## Usage
``` python
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import neuralfilter

(x_tr, y_tr), (x_te, y_te) = tf.keras.datasets.mnist.load_data()

idx = 1
a = neuralfilter.generate(np.expand_dims(x_tr[idx], axis=-1))

plt.figure(figsize=(9, 3), dpi=100)
plt.subplot(1, 3, 1)
plt.imshow(x_tr[idx], cmap='gray')
plt.xticks([], [])
plt.yticks([], [])

plt.subplot(1, 3, 2)
plt.imshow(a, cmap='jet')
plt.xticks([], [])
plt.yticks([], [])

plt.subplot(1, 3, 3)
plt.imshow(x_tr[idx], cmap='gray')
plt.imshow(a, cmap='jet', alpha=0.5)
plt.xticks([], [])
plt.yticks([], [])

plt.tight_layout()
plt.savefig('sample.png')
plt.show()
```

<img src="https://github.com/YeongHyeon/NeuralFilter/blob/main/figures/sample.png" width="500">


