본문 바로가기

분류 전체보기

(51)
[이코테] 큰 수의 법칙 풀이 과정 1. 문제를 정독하면서 메모한다. 주의해야 할 것은 ※으로 표시한다. 입력 첫째 줄에 배열의 크기 N, 주어진 수들을 더하는 횟수 M, 연속해서 초과하여 더해질 수 없는 횟수 K가 주어지고 둘째 줄에 배열에 해당하는 N개의 자연수가 주어진다. 서로 다른 인덱스에 해당하는 수가 같은 경우에도 서로 다른 것으로 간주한다는 것은 주의할 사항이므로 ※으로 따로 표시했다. 입력 조건도 메모했다. 그리고 문제에서 예시로 든 케이스를 하나하나 살펴보며 규칙을 찾으려 노력했다. 2. 알고리즘을 떠올리고 적용하려고 노력한다. 이건 그리디 알고리즘 실전 문제이므로 이미 알고리즘은 알고 있었다. 그리디 알고리즘은 지금 당장 좋은 것만 선택하는 알고리즘이다. 지금 당장 좋은 것만 선택했을 때 나올 수 있는 경우의 ..
Conv1D, Conv2D, Conv3D 차이 말 그대로다. 1차원 배열 데이터에는 Conv1D를, 2차원 배열 데이터에는 Conv2D를 사용한다. 아직까지 Conv3D를 사용해 본 적은 없지만 마찬가지로 3차원 배열 데이터에 사용한다. 즉, Conv1D, Conv2D, Conv3D 차이는 입력 데이터의 차원이다. 그런데 여기서 끝나면 의문이 생긴다. 코드를 보자. model = tf.keras.models.Sequential([ # Note the input shape is the desired size of the image 150x150 with 3 bytes color tf.keras.layers.Conv2D(64, (3,3), activation='relu', input_shape=(150, 150, 3)), tf.keras.layers.M..
include_top의 의미 The inception V3 has a fully-connected layer at the top. So by setting include_top to false, you're specifying that you want to ignore this and get straight to the convolutions. -> top에 fully-connected layer가 있는 경우 include_top=False를 하면 무시하고 바로 convolution으로 가게 해 줌. 근데 fully-connected layer는 보통 bottom에 있지 top에 없지 않나? Tensorflow 공식문서에서 include_top 매개변수 설명을 찾아보니 whether to include the fully-connec..
입력 이미지(input image)를 정규화(normalize)하는 이유 As you may already know, data that goes into neural networks should usually be normalized in some way to make it more amenable to processing by the network. (It is uncommon to feed raw pixels into a convnet.) -> input image를 normalize하면 네트워크가 데이터를 처리하기가 더 쉬워진다고 합니다. 실제로 raw pixel을 그대로 CNN에 넣는 일은 드물다고 하네요. from tensorflow.keras.preprocessing.image import ImageDataGenerator # All images will be re..
ValueError: output array is read-only mnist = tf.keras.datasets.fashion_mnist (training_images, training_labels), (test_images, test_labels) = mnist.load_data() training_images /= 255.0 test_images /= 255.0 model = tf.keras.models.Sequential([ tf.keras.layers.Flatten(), tf.keras.layers.Dense(128, activation=tf.nn.relu), tf.keras.layers.Dense(10, activation=tf.nn.softmax) ]) model.compile(optimizer="adam", loss="sparse_categorical_cr..