Posts

Repetition in C

Repetitions can be achieved through the use of 'for, while, and do while'. as such: for(condition){ statement; } while(condition){ statement } do{statement}while(condition) do while and while are fundamentally different because in do while the statement is run at least one time before checking the condition

Materi GSLC 1 A.I.

Materi GSLC Stanford- https://www.youtube.com/playlist?list=PLC1qU-LWwrF64f4QKQT-Vg5Wr4qEE1Zxk

materi dasar deep learning

neural network - perceptron/neuron - weight - bias - activation function - layer convolutional neural network - convolutional layer - pooling layer - fully connected layer - feature map - ReLU Ini tema2 dasar untuk paham deep learning.

Assignment 3 A.I.

File H5nya(6GB boii) accuracy masih aneh, training data dapetnya 100%acc, test data nyangkut 50.00% import h5py import numpy as np from keras.utils.io_utils import HDF5Matrix import keras from keras.models import Model from keras.layers import Input from keras.layers import Dense from keras.layers import Conv2D from keras.layers import MaxPooling2D from keras.layers import Flatten from keras.layers import Dropout from keras import optimizers def nz_pixel(data):  return data/255-.5 def generate_tr():  i=0  X_d = HDF5Matrix('DDSM_RGB-001.h5', 'features', normalizer=nz_pixel)  y_d = HDF5Matrix('DDSM_RGB-001.h5', 'targets')  size = 2000  while 1:   X_s = X_d[i%size].reshape(*X_d[i%size].shape[:1], -1, *X_d[i%size].shape[-2:])   X_s = X_s.reshape(1, 224, 224, 12)   y_s = y_d[i%size].reshape(1, 4)   yield(X_s, y_s)   i+=1 def generate_te():  i=0  X_d = HDF5Matrix('DDSM_RGB-001.h5', 'features', normalizer=nz_pixel)  y_d = HDF5Matrix(&#

Assignment 2 A.I.

File HDF5nya import h5py import numpy as np import keras from keras.models import Model from keras.layers import Input from keras.layers import Dense from keras.layers import Conv2D from keras.layers import MaxPooling2D from keras.layers import Flatten from keras.layers import Dropout f=h5py.File('MNIST.hdf5','r') a = np.array(f['normalized_full']['training']['default']) X_train = a.reshape(a.shape[1:4]) b = np.array(f['normalized_full']['test']['default']) X_test = b.reshape(b.shape[1:4]) c = np.array(f['normalized_full']['training']['targets']) y_train = c.reshape(c.shape[1:4]) d = np.array(f['normalized_full']['test']['targets']) y_test = d.reshape(d.shape[1:4]) X_train = X_train.reshape(X_train.shape[0], 28, 28, 1) X_test = X_test.reshape(X_test.shape[0], 28, 28, 1) num_classes = 10 y_train = keras.utils.to_categorical(y_train, num_classes) y_t

Assignment 1 A.I.

from PIL import Image import numpy as np f=np.array(Image.open('FILENAME')) f[:9,:9]=255 f=Image.fromarray(f) f.save('NEWNAME') f.show()