잡다한 IT 썸네일형 리스트형 MMIO , PMIO , I/O MIO https://ko.wikipedia.org/wiki/%EB%A9%94%EB%AA%A8%EB%A6%AC_%EB%A7%B5_%EC%9E%85%EC%B6%9C%EB%A0%A5 (위키피디아) https://sites.google.com/site/hwangslabo/question-stack/mmiopmiolanmueos-inga (MMIO, PMIO 및 RISC 특징) http://shinluckyarchive.tistory.com/237 (MMIO 와 I/O MIO) https://superuser.com/questions/703695/difference-between-port-mapped-and-memory-mapped-access (영어 설명) 더보기 scanf '\n' 관련 리눅스 프로그래밍 공부를 하다가 scanf("%d %s\n", ...) 이라는 문구를 만났는데 \n이 왜 사용되었는지 의문이었다. 그 해답 http://electro-don.tistory.com/entry/scanf-n-%EA%B4%80%EB%A0%A8(참고사이트) 더보기 pthread 관련 함수-2 Thread 동기화 ■ Mutex 함수 - mutex 잠금 객체를 만드는 함수 : pthread_mutex_init() - mutex 잠금을 얻는 함수 : pthread_mutex_lock() - mutex 잠금을 되돌려주는 함수 : pthread_mutex_unlock() - mutex 잠금 객체를 제거하는 함수 : pthread_mutex_destroy() ■ pthread_mutex_init() 12#includeint pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutex_attr *attr); mutex : mutex 잠금 객체 mutex_attr : 이 값을 이용해서 mutex 타입을 결정할 수 있음. NULL 일 경우 기본값이 fast.. 더보기 pthread 관련 함수-1 ■ pthread_create() : 쓰레드 생성 12#includeint pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) thread : 쓰레드가 성공적으로 생성되었을 때, 넘겨주는 쓰레드 식별 번호 attr : 쓰레드의 특성을 설정하기 위해서 사용한다. NULL 일 경우 기본 특성 start_routine : 쓰레드가 수행할 함수로 함수포인터를 넘겨준다. arg : 쓰레드 함수 start_routine을 실행시킬 때, 넘겨줄 인자 ■ pthread_join() : 쓰레드 종료/정리 ( process wait()함수와 비슷) 12#includeint pthread_join(p.. 더보기 06-2. Softemax_zoo_classifier ■ 파일 처리 Softmax 구현 ▶ 사용된 텐서플로우 APItf.nn.softmax_cross_entropy_with_logitstf.argmax cost_i = tf.nn.softmax_cross_entropy_with_logits(logits=logits,labels=Y_one_hot)- logits = tf.matmul(X,W)+ b 에서 바로 cost 함수를 얻는다.- hypothesis = tf.nn.softmax(logits) 은 사용하지 않고 예측할 때 사용된다. cost = tf.reduce_mean(cost_i)- 코스트 함수의 평균을 구한다. optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.1).minimize(cost)-.. 더보기 06-1. Softmax classfier ■ Softmax 구현 (Multinomial Logistic Regression) hypothesis = tf.nn.softmax(tf.matmul(X,W)+b)- hypothesis 에서 tf.matmul(X,W)+b 에 tf.nn.softmax 함수 적용 cost = tf.reduce_mean(-tf.reduce_sum(Y*tf.log(hypothesis),axis=1))- Cross Entropy 를 코스트 함수로 사용한다. optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.1).minimize(cost)- learining_rate 를 0.1로 학습함. 1234567891011121314151617181920212223242526272.. 더보기 05-2. Logistic regression diabetes ■ Logistic regression 을 파일로 읽어서 처리한다. xp = np.loadtxt('data-03-diabetes.csv',delimiter=',', dtype=np.float32)- data-03-diabetes.csv 로 부터 데이터를 읽음 x_data = xy[:,0:-1]y_data = xy[:,[-1]]- 데이터 분리 print(x_data.shpae,y_data.shape)- 데이터가 제대로 분리되었는지 확인 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081.. 더보기 05-1. Logistic Regression Classifier ■ sigmoid 함수를 사용한 binary classifier hypothesis = tf.sigmoid(tf.matmul(X,W)+b)- hypothesis 에서 tf.matmul(X,W)+b 에 sigmoid 함수를 적용 cost = -tf.reduce_mean(Y*tf.log(hypothesis)+(1-Y)*tf.log(1-hypothesis))- Cross Entropy 를 코스트 함수로 사용한다.- 1인 경우 Y*tf.log(hypothesis) 가 0으로 수렴하도록 학습- 0인 경우 (1-Y)*tf.log(1-hypothesis) 가 0으로 수렴하도록 학습 train = tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(cost).. 더보기 이전 1 2 3 4 5 ··· 13 다음