<Kaggle>/[TensorFlow Speech Recognition]
-
3/28<Kaggle>/[TensorFlow Speech Recognition] 2022. 3. 28. 21:19
- tf.constant() - tf.Variable() - tf.placeholder() # tf.constant() : 변하지 않는 상수 생성 # tf.Variable() : 값이 바뀔 수도 있는 변수 생성 import tensorflow as tf sess = tf.Session() x1 = tf.constant([10], dtype=tf.float32, name='test1') x2 = tf.Variable([8], dtype=tf.float32, name='test2') init = tf.global_variables_initializer() sess.run(init) # 초기화 먼저 진행 print(sess.run(x1)) # 값 부여 ## tf.placeholder + feed_dict : ..
-
3/26<Kaggle>/[TensorFlow Speech Recognition] 2022. 3. 26. 21:25
-tf.placeholder() : 선언한 후, 값을 부여한다. - clip = noise[idx:(idx+16000)] - glob.glob(path, recursive=True) from glob import glob 파라미터 recursive=True 로 설정하고 ** 로 작성하면 하위 폴더에도 접근할 수 있습니다 - filter(조건 함수, 순회 가능한 데이터) - map(조건 함수, 순회 가능한 데이터) - .strip() : 문자열/공백 제거 ex_str = " abc " ex_str.strip() # 'abc'
-
3/25<Kaggle>/[TensorFlow Speech Recognition] 2022. 3. 25. 21:28
- np.random.RandomState() if state is None else state # 방법1 if state is None: np.random.RandomState() else: state # 방법2 np.random.RandomState() if state is None else state - .real a = 1+2j a.real # 1.0 a.imag # 2.0 - 이중 def def abc(x): def ab(*arg, **kwargs) return x(*arg, **kwargs) return ab - 이중 for문 + 람다함수 # 방법1 flatten = lambda l: [item for sublist in l for item in sublist] # 방법2 for sublist..
-
3/23<Kaggle>/[TensorFlow Speech Recognition] 2022. 3. 23. 21:26
tf config = tf.ConfigProto() # 1. GPU 설정 config.gpu_options.visible_device_list = device # GPU가 2개면, 첫 번째 GPU -> "0", 두번째 GPU -> "1" 로 설정 # 2. GPU 사용량 조절 config.gpu_options.per_process_gpu_memory_fraction = memory_fraction # memory_fraction=1 : 100% 사용 # config.gpu_options.allow_growth = False # True : 필요할 때마다 GPU 사용률 조절, False : GPU의 모든 메모리를 점유 # 3. GPU 대비/검사 config.allow_soft_placement = True ..
-
3/22<Kaggle>/[TensorFlow Speech Recognition] 2022. 3. 22. 21:11
np.pad() a = [1,2,3] # 왼쪽 2개, 오른쪽 3개 0으로 패딩합니다 np.pad(a, pad_widtd=(2,3), mode='constant', constant_values=0) >>> [0,0,1,2,3,0,0,0] from glob import glob # glob는 파일들의 리스트를 뽑을 때 사용하는데, 파일의 경로명을 이용해서 입맛대로 요리할 수 있답니다. import gc # 직접 할당/해제하지 않아도 객체가 현재 쓰이는곳이 없을 경우 자동으로 해제 import re # re(gex)가 제공하는 함수 : match(), fullmatch(), findall(), search() 등 - 인덱스, 원하는 문자열 찾기 import shutil # 고수준 파일 연산 # shutil 모..