StoryCode

용어

Database 관리/Mongo DB
반응형

[참조] https://www.a-mean-blog.com/ko/blog/MEAN-Stack/_/MEAN-Stack-%EC%86%8C%EA%B0%9C

 

몽고DB는 대표적인 NoSQL, Non Relational Database

문장, 이미지데이터(base64) 등 길이가 길고 일정하지 않은 데이터들을 저장하고 검색하는데 적합한 DB

고전적인 테이블, 행, 열의 개념이 없음

 

document : 하나의 데이터. JSON형식. Javascript의 object와 마찬가지로 고정된 형식이 없으며 항목의 추가 삭제가 자유

 

collection : document의 모음.

 

데이터의 조작은 SQL대신 Javascript로 할 수 있습니다.

반응형

'Database 관리 > Mongo DB' 카테고리의 다른 글

MongoDB vs MySQL CRUD 비교  (0) 2019.04.21
성능 최적화 전략  (0) 2019.04.21
기초사용법  (0) 2019.04.18
설치 ( Windows )  (0) 2019.04.18

한글 받침 구별법

JavaScript, ECMAScript
반응형

[참조] https://tk2rush90.blog.me/221085154547

[참조] http://blog.naver.com/PostView.nhn?blogId=azure0777&logNo=221414175631&categoryNo=0&parentCategoryNo=0&viewDate=¤tPage=1&postListTopCurrentPage=1&from=postView&userTopListOpen=true&userTopListCount=5&userTopListManageOpen=false&userTopListCurrentPage=1

 

- 자음 유니코드

let uni = 12593; // 유니코드를 문자로 변환하는 함수 12593~12622

String.fromCharCode();

while(uni) {

   let kor = String.fromCharCode(uni);

   console.log("kor : " + kor + " - uni);

   if(kor === "ㅎ") break;

   uni++;

}

 

 

- 모음 유니코드 :  12623 ~ 12643

문자 내에서 초성, 중성, 종성으로 쓰이는 자모음은 위 표와 같으며, 종성은 숫자 1마다, 중성은 29마다, 초성은 589마다 값이 변한다는 사실을 알 수 있다. 이 내용을 토대로 한글 문자를 분리하는 기능을 만들어보자.

 

- 한글 문자 분리

function getConstantVowel(kor) {
    const f = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ',
               'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ',
               'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'];
    const s = ['ㅏ', 'ㅐ', 'ㅑ', 'ㅒ', 'ㅓ', 'ㅔ', 'ㅕ',
               'ㅖ', 'ㅗ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅛ', 'ㅜ',
               'ㅝ', 'ㅞ', 'ㅟ', 'ㅠ', 'ㅡ', 'ㅢ', 'ㅣ'];
    const t = ['', 'ㄱ', 'ㄲ', 'ㄳ', 'ㄴ', 'ㄵ', 'ㄶ',
               'ㄷ', 'ㄹ', 'ㄺ', 'ㄻ', 'ㄼ', 'ㄽ', 'ㄾ',
               'ㄿ', 'ㅀ', 'ㅁ', 'ㅂ', 'ㅄ', 'ㅅ', 'ㅆ',
               'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'];

    const ga = 44032;
    let uni = kor.charCodeAt(0);

    uni = uni - ga;

    let fn = parseInt(uni / 588);
    let sn = parseInt((uni - (fn * 588)) / 28);
    let tn = parseInt(uni % 28);

    return {
        f: f[fn],
        s: s[sn],
        t: t[tn]
    };
}

- 받침 유무 ( ~가/이 구분용 )

function checkBatchimEnding(word) {
  if (typeof word !== 'string') return null;
 
  var lastLetter = word[word.length - 1];
  var uni = lastLetter.charCodeAt(0);
 
  if (uni < 44032 || uni > 55203) return null;
 
  return (uni - 44032) % 28 != 0;
}


 

반응형

'JavaScript, ECMAScript' 카테고리의 다른 글

자바스크립트 역사.  (0) 2020.09.21
Count, 카운트  (0) 2020.03.09
실수를 정수로 바꾸는 방법  (0) 2020.03.04
Hoisting.호이스팅  (0) 2020.02.12
자바스크립트.변수.모니터링워처  (0) 2020.02.01

중국 총리 저우언라이 (주은래)

짤지식
반응형

 

반응형

'짤지식' 카테고리의 다른 글

5월의 광주  (0) 2019.09.15
Planet of Solar System  (0) 2019.06.02
영장류 동물이 사회적 금기를 만드는 과정  (0) 2019.04.03
100명으로 본 2011년의 세계  (0) 2019.04.03
소아마비 백신, 소크 박사  (0) 2019.04.02

영장류 동물이 사회적 금기를 만드는 과정

짤지식
반응형

반응형

100명으로 본 2011년의 세계

짤지식
반응형

반응형

소아마비 백신, 소크 박사

짤지식
반응형

 

반응형

광복직후 조선을 왜 떠나야하는지 몰랐던 일본인들

짤지식
반응형

반응형

AttributeError: 'module' object has no attribute 'pack'

인공지능,AI,학습,ML,Tensorflow, Cafee2,MLFlow/Tensorflow
반응형

Attribute tf.pack 이 tf.stack 으로 변경됨.

반응형

NotFoundError: Key ... not found in checkpoint

인공지능,AI,학습,ML,Tensorflow, Cafee2,MLFlow/Tensorflow
반응형

오류 상황) 변수를 저장후 출력해보면, 변수명 끝에 _1 이 붙는다.

실행을 한 번더 하면 _2 가 된다.


해결) 커널 리스타트 를 해야 한다. 중간부터 다시 실행하면 "오류상황" 과 같은 문제가 발생한다.

쥬피터에서는 동그란 화살표의 Restart 버튼을 클릭하면 된다.

반응형

Saver 에서 save 후, CheckpointVariables 변수 보기

인공지능,AI,학습,ML,Tensorflow, Cafee2,MLFlow/Tensorflow
반응형

1) 아래 소스 추가


inspect_checkpoint.py


2) Traine 소스에서, 


임포트후,

from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file


저장하고,

ckpt_path = saver.save(sess, 'saved1/train1')


출력하면

print_tensors_in_checkpoint_file(ckpt_path, all_tensors=True, tensor_name='', all_tensor_names=False)


결과가 나온다.

tensor_name:  b_h1_3

[ 1.5395054e-03  0.0000000e+00  1.7294792e-02 -1.9801984e-05

 -3.9077952e-04  1.9007076e-07  2.1687772e-02  1.2043750e-05

  2.5410240e-04  0.0000000e+00]











PS) print_tensors_in_checkpoint_file 파라미터 설명


file_name: not a physical file, just the prefix of filenames

If no tensor_name is provided, prints the tensor names and shapes in the checkpoint file. If tensor_name is provided, prints the content of the tensor.(inspect_checkpoint.py)

If all_tensor_names is True, Prints all the tensor names

If all_tensor is 'True`, Prints all the tensor names and the corresponding content.

N.B. all_tensor and all_tensor_names will override tensor_name

반응형