André Claudino
André Claudino
https://www.linkedin.com/in/andreclaudino/
https://github.com/andreclaudino
http://t.me/aclaudino
Modelo
Encoder
Classificador
$> python3.6 -m virtualenv venv
$> sourve venv/bin/activate
$> nano setup.py
from setuptools import setup, find_packages
setup(
name='classificador',
version='',
packages=find_packages(),
url='',
license='',
author='Time IA-FRONT',
author_email='',
description='',
install_requires=[
"tensorflow==2.1.0",
"click==7.1.2"
]
)
Coletar dados de arquivos
from typing import Sequence, Optional
import tensorflow as tf
PRELOAD_FACTOR = 3
def load_microdata_from_csv(path: str, defaults: Sequence[tf.Tensor], batch_size: int,
repeats: Optional[int] = None,
limit: Optional[int] = None) -> tf.data.Dataset:
buffer_size = PRELOAD_FACTOR*batch_size
dataset = tf.data.experimental.CsvDataset(
path, defaults, buffer_size=buffer_size,
header=True, select_cols=None
).shuffle(buffer_size)
dataset = dataset.limit(limit) if limit else dataset
dataset = dataset.repeat(repeats) if repeats else dataset
return dataset.batch(batch_size)
Valeu!
https://www.linkedin.com/in/andreclaudino/
https://github.com/andreclaudino
http://t.me/aclaudino