대충   이렇게 생긴 USB 형태의 Bluetooth 송수신 동글.

드라이버 다운로드는 여기서

Wide Applications:
1. Travelling: suitcase, handbag, travel bag, luggage, laptop, backpack, handbag, and so on.
2. Sports: gym locker, bike, bicycle, golf bags, and so on.
3. Public Areas: student dormitory, school locker, gym locker, employee locker, hospital locker, and so on.
4. Residential: door lock, gate, apartment lock, basement anti-theft security, and so on.
5. Business: office, hospital, fence, and so on.
6. Transportation: garage, toolbox, and so on .
7. Furniture: wardrobes, closet, cabinet, drawers, safes, and so on.


Specifications:
* Fingerprint reader: 96*96 sensor
* Waterproof level: IP56
* FRR:<1%
* FAR:<0.002%
* Material: zinc alloy
* Working voltage: 3.0-4.2V
* Lock weight and Size: 90g
* Lock size: 7.6*4.6*1.3(cm)
* Fingerprint sensor coverage: 72*64MM
*Unlock speed: within 0.5 second
*working period: a year per power Charge
* LED light: three color light: red / blue / green
* Battery: 3.7V lithium build in battery
* Working temperature: -10~+40 degrees Celsius
* Fingerprint capacity: record 10 times and save 10 groups

 

 

 

 

 

 

 

 

1. 저장하기

import tensorflow.compat.v1 as tf
import numpy as np
import gym
from collections import deque
import random
import os

tf.disable_v2_behavior()


def createFolder(directory):
    try:
        if not os.path.exists(directory):
            os.makedirs(directory)
    except OSError:
        print ('Error: Creating directory. ' +  directory)


sess = tf.Session()


DQNmain = DQNet(sess, input_size, output_size, "DQNMain")
modelSaver= tf.train.Saver(var_list= tf.global_variables(), allow_empty=False)
sess.run( tf.global_variables_initializer())

.....
.....

여러 코드 구현

.....
.....


createFolder('my_test_model')
modelSaver.save(sess, 'my_test_model/mymodel', write_meta_graph = False, global_step=global_step)

 

 

 

2. 불러다 쓰기

sess = tf.Session()

# 네트워크 구성
DQNmain = DQNet(sess, input_size, output_size, "DQNMain")

# modelsaver
modelSaver = tf.train.Saver(var_list = tf.global_variables(), allow_empty=False)

# 저장된 checkpoint 있는지 체크..
# 있으면 load.. 없으면 에러
ckpt = tf.train.get_checkpoint_state('my_test_model/')
if ckpt and tf.train.checkpoint_exists(ckpt.model_checkpoint_path):
    modelSaver.restore(sess, ckpt.model_checkpoint_path)
else:
    print("Model data not found...")
    exit()

 

1. MathJax

아래와 같이 수식입력이 필요한 경우 MathJax Library를 사용하면 편리하다

MathJax는 MathML, LaTeX 및 ASCIIMathML 마크 업을 사용하여 웹 브라우저에 수학 표기법을 표시하는 크로스 브라우저 JavaScript 라이브러리이다.

MathJax는 아파치 라이선스에 따라 오픈 소스 소프트웨어로 제공된다

 

2. 다운로드

MathJax 의 GitHub 홈페이지에서 소스를 다운로드 받을 수 있습니다만, 다운로드 없이 그냥 쓰기로 합니다.

(다른 블로그에서도 다운로드 없이 그냥 쓰네요)

 

GitHub - mathjax/MathJax-src: MathJax source code for version 3 and beyond

MathJax source code for version 3 and beyond. Contribute to mathjax/MathJax-src development by creating an account on GitHub.

github.com

 

3. 블로그 관리에서 파일 업로드 및 HTML 편집

블로그 관리 > 꾸미기 > 스킨편집 > HTML 를 통해 HTML을 편집한다.

<head></head> 사이에 아래 코드를 추가하면 된다.

아래 코드를 복사해서 적용하세요

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

 

4. 수식입력 테스트

글쓰기로 입력하면 수식이 나옵니다.

결과

 

5. 수식입력기

저 복잡한 문법을 익히기도 어렵습니다.

온라인으로 저 수식을 만들어주는 웹사이트가 있습니다.

CodeCog에서 수식을 만들고 블로그에 올리세요.

 

 

Online LaTeX Equation Editor - create, integrate and download online.

EqnEditor (v5 beta) for online mathematics - delivering thousands of beautiful equations every second -

editor.codecogs.com

1. 개요

SyntaxHighlighter는 블로그나 웹사이트에서 사용할 수 있는 코드 구문 하이라이터입니다.
HTML, Javascript, Python, C 등 여러 언어에 사용할 수 있고 스크린샷 같은 방식보다 가독성이 좋습니다.

2. 파일 다운로드

최신 버전은 4.0인데 별도의 빌드 과정이 필요합니다. 빌드를 해서라도 4.0 버전을 사용하려는 분들은 GitHub에서 직접 다운로드 하십시오.

https://github.com/syntaxhighlighter/syntaxhighlighter

 

GitHub - syntaxhighlighter/syntaxhighlighter: SyntaxHighlighter is a fully functional self-contained code syntax highlighter dev

SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript. - GitHub - syntaxhighlighter/syntaxhighlighter: SyntaxHighlighter is a fully functional self-...

github.com

저는 빌드하기 귀찮으니... 3.08 버전을 사용합니다.

syntaxhighlighter-3.0.83.zip
4.49MB

혹은 다음 링크를 이용하세요

https://github.com/syntaxhighlighter/syntaxhighlighter/archive/3.0.83.zip

상기 소스를 다운 받고 압축을 풉니다

 

3. Scripts와 Styles내 파일들 업로드하기

블로그 설정 -&amp;amp;amp;amp;amp;amp;amp;gt; 꾸미기 -&amp;amp;amp;amp;amp;amp;amp;gt; 스킨 편집

 

필요한 파일들을 업로드 하기 위해 업로드 페이지로 들어갑니다

압축을 푼 폴더에서 scripts 폴더와 styles 폴더에 있는 파일들을 전부 업로드합니다.

4. HTML 편집하기

HTML 페이지로 들어가 아래와 같이 필요한 파일들을 채워 넣습니다.

 

<!--Syntaxhighlighter 코드시작 (순서도 중요한듯)-->
<script type="text/javascript" src="./images/XRegExp.js"></script>          <!--정규식처리용-->
<script type="text/javascript" src="./images/shCore.js"></script>
<script type="text/javascript" src="./images/shBrushCpp.js"></script>       <!--브러시들 필요에 따라서 추가-->
<script type="text/javascript" src="./images/shBrushCss.js"></script>
<script type="text/javascript" src="./images/shBrushJScript.js"></script>
<script type="text/javascript" src="./images/shBrushPython.js"></script>
<script type="text/javascript" src="./images/shBrushXml.js"></script>
<script type="text/javascript" src="./images/shAutoloader.js"></script>
<link type="text/css" rel="stylesheet" href="./images/shCore.css">          <!--코어스타일-->
<link type="text/css" rel="Stylesheet" href="./images/shThemeDefault.css">
<!---link type="text/css" rel="stylesheet" href="./images/shThemeMidnight.css" /---> <!--테마-->
<script type="text/javascript"> SyntaxHighlighter.all(); </script>
<style>
.syntaxhighlighter { padding-bottom: 1px; }
</style> <!-- 스크롤바 제거 -->
<!--Syntaxhighlighter 코드종료-->

입력을 다 했으면 "적용" 버튼을 누릅니다.

4. 사용 방법

블로그 글쓰기에서 HTML모드로 진입합니다.

아래와 같은 방법으로 직접 입력합니다

<pre class="brush:사용할 언어>

소스 코드
이것
저것

</pre>

 

예를 들면...

1. Tensorflow 2.X Ver#1

import gym
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt

env = gym.make('FrozenLake-v0')


learning_rate = 0.1
input_size = env.observation_space.n
output_size = env.action_space.n
dis=.99
num_episodes=2000


model = tf.keras.Sequential([
    tf.keras.layers.Dense(output_size, input_shape=[input_size],
                         kernel_initializer=tf.random_uniform_initializer(minval=0, maxval=0.01))
])
model.compile(optimizer=tf.train.GradientDescentOptimizer(learning_rate=learning_rate), loss='mse')
model.summary()


rList=[]
for i in range(num_episodes):
    s = env.reset()
    e = 1.0 / ((i/50)+10)
    rAll = 0
    done = False

    while not done:
        Qs = model.predict(one_hot(s))
        if np.random.rand(1) < e:
            a = env.action_space.sample()
        else:
            a = np.argmax(Qs)

        s1, reward, done, _ = env.step(a)
        if done:
            Qs[0, a] = reward
        else:
            Qs1 = model.predict(one_hot(s1))
            Qs[0, a] = reward + dis*np.max(Qs1)

        model.fit(x=one_hot(s), y=Qs)

        rAll += reward
        s= s1

    rList.append(rAll)

print("Percent of successful episode: "+str(sum(rList)/num_episodes)+"%")
plt.bar(range(len(rList)), rList, color='blue')
plt.show()

2. Tensorflow 2.X Ver2

import tensorflow as tf
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
import gym
import matplotlib.pyplot as plt



def SumSqureError(y_true, y_pred):
    return tf.reduce_sum( tf.square(y_true - y_pred) )


def my_init(shape, dtype=None):
    return np.random.uniform(0, 0.01, shape)



env = gym.make("FrozenLake-v1")
INPUT_ONE_HOT = np.identity(env.observation_space.n)

model = keras.Sequential()
model.add(layers.Dense(env.action_space.n, input_shape=(None, env.observation_space.n), kernel_initializer=my_init))
model.summary()
model.compile(optimizer=tf.keras.optimizers.SGD(learning_rate=0.1), loss=SumSqureError, metrics=['accuracy'])


dis = 0.99
episodes = 2000
rList = []


def one_hot(x):
    return INPUT_ONE_HOT[x:x + 1]


rAll = 0

for i in range(episodes):
    state = env.reset()

    e = 1.0 / ((i / 50) + 10)
    Done = False

    while not Done :
        Qs = model.predict(one_hot(state))
        
        if np.random.rand(1) < e:
            action = env.action_space.sample()
        else:
            action = np.argmax( Qs )

        new_state, reward, Done, _ = env.step(action)
        #env.render()


        if Done:
            rList.append(reward)
            rAll += reward
            Qs[0,action] = reward
        else :
            Qs[0,action] = reward + dis * np.max(model.predict(one_hot(new_state)))
 
        
        model.fit(one_hot(state), Qs)
        state = new_state

    if (i % 200 == 0) and (i > 0):
        print("Prgress : ", (i/episodes), "  ==> ", (rAll / i))



print("Success rate: " + str(rAll / episodes))
plt.bar(range(len(rList)), rList, color="blue")
plt.show()

env.close()

 

 

2. Tensorflow 1.X

import tensorflow.compat.v1 as tf
import numpy as np
import gym
import matplotlib.pyplot as plt

tf.disable_v2_behavior()




env = gym.make('FrozenLake-v1')
input_size = env.observation_space.n
output_size = env.action_space.n

episodes = 2000
rAll = 0
rList = []
dis = 0.99
Done = False
ONE_HOT = np.identity(input_size)


X = tf.placeholder(shape=[1, input_size], dtype=tf.float32)
#W = tf.Variable(tf.random_normal([input_size, output_size]))
W = tf.Variable(tf.random_uniform([input_size, output_size], 0, 0.01))
Y = tf.placeholder(shape=[1, output_size], dtype=tf.float32)

Qpred = tf.matmul(X, W)
cost = tf.reduce_sum(tf.square(Y - Qpred))
train = tf.train.GradientDescentOptimizer(learning_rate = 0.1).minimize(cost)

sess = tf.Session();
sess.run(tf.global_variables_initializer())

def one_hot(x):
    return ONE_HOT[x:x + 1]

for i in range(episodes):
    
    state = env.reset()
    Done = False
    #e = 1. / ((i / 50) + 10)
    e =  1. / ((i / 50) + 10)
    
    while not Done :
        Qs = sess.run(Qpred, feed_dict={X: one_hot(state)})
        
        if np.random.rand(1) < e:
            action = env.action_space.sample()
        else:
            action = np.argmax(Qs)
            
        new_state, reward, Done, _ = env.step(action)
        #env.render()
        
        if Done:
            rAll += reward
            rList.append(reward)
            # Update Q, and no Qs+1, since it's a terminal state
            Qs[0, action] = reward
        else:
            # Obtain the Q_s1 values by feeding the new state through our
            # network
            Qs1 = sess.run(Qpred, feed_dict={X: one_hot(new_state)})
            # Update Q
            Qs[0, action] = reward + dis * np.max(Qs1)
            
        sess.run(train, feed_dict={X: one_hot(state), Y: Qs})
        state = new_state
    
    if (i % 200 == 0) and (i > 0):
        print("Prgress : ", (i/episodes), "  ==> ", (rAll / i))

print("Percent of success of episodes : ", (rAll / episodes))
plt.bar(range(len(rList)), rList, color="blue")
plt.show()

env.close()

https://www.youtube.com/watch?v=ZYX0FaqUeN4 

import numpy as np

t = np.array([[[0,1,2], [3,4,5]], [[6,7,8],[9,10,11]]])
print(t)
print("shape=",t.shape)
print("----------------------")
print("reshape#1")
ar = np.reshape(t, (-1,3))
print(ar)
print("shape=",ar.shape)
print("----------------------")
print("reshape#2")
ar = np.reshape(ar, (-1,1,3))
print(ar)
print("shape=",ar.shape)
print("----------------------")
print("squeeze")
ar = np.squeeze([[0],[1],[2],[3]])
print( ar )
print( "shape=",ar.shape )
print("----------------------")
print("expand_dims")
ar = np.expand_dims([0, 1, 2], 1)
print( ar )
print( "shape=",ar.shape )
In [1]: 
[[[ 0  1  2]
  [ 3  4  5]]

 [[ 6  7  8]
  [ 9 10 11]]]
shape= (2, 2, 3)
----------------------
reshape#1
[[ 0  1  2]
 [ 3  4  5]
 [ 6  7  8]
 [ 9 10 11]]
shape= (4, 3)
----------------------
reshape#2
[[[ 0  1  2]]

 [[ 3  4  5]]

 [[ 6  7  8]]

 [[ 9 10 11]]]
shape= (4, 1, 3)
----------------------
squeeze
[0 1 2 3]
shape= (4,)
----------------------
expand_dims
[[0]
 [1]
 [2]]
shape= (3, 1)

 

 

 

클릭 2번이면.....

 

크롬에서 테스트 했습니다.

Microsoft edge에서는 안됩니다.

 

 

1. 메모장에 아래 내용을 복사해서 붙여 넣으세요

javascript:javascript:function testfor() { var url = "https://couponview.netmarble.com/coupon/enn/1384"; if( document.location.href!=url) { document.location.href=url; return; } var elem=document.getElementById("ip_cunpon2"); elem.value="제2의나라 회원번호를 입력하세요";} testfor();

 

2. 게임에서 회원번호를 복사하세요

 

3. 회원번호를 메모장에 붙여넣기 하세요.

 

4. 전체 선택해서 복사하세요. (복사만 해 놓으세요)

 

5. 크롬에서 아무 사이트나 바로가기 창에 바로가기를 만듭니다.

 

 

6. 바로가기 편집해서 붙여넣기 하세요.

 

 

7. Test해 봅니다. 2번 클릭 !!

    1. 주소창에 아무거나 입력

 

    2. 방금 생성 바로가기 클릭

    3. 한번 더 클릭

+ Recent posts