# Algorithm
###### tags: `賴` `algorithm` `pso` `bayesian`
## PSO


---
# [CNN code EXPLAIN](https://heartbeat.fritz.ai/a-beginners-guide-to-convolutional-neural-networks-cnn-cf26c5ee17ed)
## Compile
:::warning
We then compile the CNN using the compile function. This function expects three parameters: the optimizer, the loss function, and the metrics of performance.
:::
```python=
classifier.compile(
optimizer='adam', loss='binary_crossentropy', metrics=['acc'])
```
- reference
- https://ithelp.ithome.com.tw/articles/10191528
- https://ithelp.ithome.com.tw/articles/10198147
## ImageDataGenerator
了解這是什麼,報告的時候需要講解
```python=
train_datagen = ImageDataGenerator(
rescale=1./255,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True)
test_datagen = ImageDataGenerator(rescale=1./255)
```
target_size
input_size
batch_size
test_datagen
evaluate vs predict