교 향
Maximalism
교 향
전체 방문자
오늘
어제
  • 전체글
    • Coding
    • Linux
    • Docker
    • Python
    • AI
      • GPT
      • Pandas
      • Numpy
      • tensorflow
      • pytorch
      • openCV
      • Study
      • AIconnect - [GPT]한국어..
    • Data structure, OS
    • Competitions
    • Investment
    • Book
    • Health
    • Trip
    • Memo
    • 대학원

블로그 메뉴

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

공지사항

인기 글

태그

  • ActivationFunction #활성화함수 #인공지능면접
  • AI면접 #딥러닝면접 #인공지능면접 #기울기소실 #GradientVanishing

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
교 향

Maximalism

AI/tensorflow

[tf.data] data transform하여 dataset 추가하기

2022. 12. 22. 15:58

https://stackoverflow.com/questions/47337031/how-to-expand-tf-data-dataset-with-additional-example-transformations-in-tensorf?rq=1 

 

How to expand tf.data.Dataset with additional example transformations in Tensorflow

I would like to double the size of an existing dataset I'm using to train a neural network in tensorflow on the fly by adding random noise to it. So when I'm done I'll have all the existing example...

stackoverflow.com

def generate_permutations(features, labels):
    regular_ds = tf.data.Dataset.from_tensors((features, labels))
    noisy_ds = tf.data.Dataset.from_tensors((add_noise(features), labels))
    return regular_ds.concatenate(noisy_ds)

dataset = dataset.flat_map(generate_permutations)

 

└ regular_ds에 noisy_ds를 합치어 dataset을 만들어 내는 방법

(* noisy_ds가 후방위치)

'AI > tensorflow' 카테고리의 다른 글

[keras] predict_on_batch 와 predict의 차이 ?  (0) 2023.02.01
AttributeError: 'Functional' object has no attribute 'predict_proba'  (0) 2023.01.27
자주 사용하는 Tensor함수 정리  (0) 2022.12.22
텐서플로우 전이학습  (0) 2022.12.16
take, skip => train, val, test  (0) 2022.12.07
    'AI/tensorflow' 카테고리의 다른 글
    • [keras] predict_on_batch 와 predict의 차이 ?
    • AttributeError: 'Functional' object has no attribute 'predict_proba'
    • 자주 사용하는 Tensor함수 정리
    • 텐서플로우 전이학습
    교 향
    교 향
    AI/ML/DL

    티스토리툴바