'AI'에 해당되는 글 3건

  1. 2023.06.09 [AI] Stable Diffusion 설치 하기
  2. 2020.08.03 [Python][AI] XOR 예제
  3. 2020.07.28 [Python][AI] Perceptron 예제
Coding/Python 삽질기2023. 6. 9. 23:28

1. Python 3.10.6 설치 

https://www.python.org/downloads/release/python-3106/

 

Python Release Python 3.10.6

The official home of the Python Programming Language

www.python.org

2.  Git 설치

https://git-scm.com/downloads

 

Git - Downloads

Downloads macOS Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific exp

git-scm.com

3. Stable diffusion webui 설치

https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

 

GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI

Stable Diffusion web UI. Contribute to AUTOMATIC1111/stable-diffusion-webui development by creating an account on GitHub.

github.com

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui

4. 모델 다운로드

https://civitai.com/

 

Civitai | Stable Diffusion models, embeddings, LoRAs and more

Civitai is a platform for Stable Diffusion AI Art models. Browse a collection of thousands of models from a growing number of creators. Join an engaged community in reviewing models and sharing images with prompts to get you started.

civitai.com

https://huggingface.co/WarriorMama777/OrangeMixs

 

WarriorMama777/OrangeMixs · Hugging Face

AOM3 Counterfeit2.5 Add SUM @ 1.0 0,0.6,0.6,0.6,0.6,0.6,0,0,0,0,0.6,0.1,0.6,0.6,0.6,0.6,0.6,0.5,0.1,0.1,0.6,0.6,0.2,0.6,0.6,0.6 AOM3A3

huggingface.co

 

모델을 다운 받아서, \stable-diffusion-webui\models\Stable-diffusion 에 넣어 준다.

확장자가 .safetensors 인 것을 받는 걸 추천 한다.

5. 실행

webui-user.bat 를 수행한다. (첫 실행시 이것 저것 설치한다고 시간이 걸린다.)

6. http://127.0.0.1:7860/ 로 웹 브라우저로 접속 하면 된다.

'Coding > Python 삽질기' 카테고리의 다른 글

HTTP Protocol  (0) 2023.08.18
[Python] PyTorch 설치  (0) 2023.04.05
[ChatGPT에게 묻다] python으로 Simple Stack VM 만들기 (3)  (0) 2023.03.17
Posted by chobocho
Coding/Python 삽질기2020. 8. 3. 22:33

아래와 같이 1개의 은닉층을 가진 신경망을 구성해 보았습니다.

 

import numpy as np

def sigmoid(x):
    return 1/(1+np.exp(-x))


def DeltaSGD(W1, W2, X, D):
    alpha = 0.9
    
    idx = 0
    for k in X:
        a1 = np.dot(W1, k)
        z1 = sigmoid(a1)
        
        a2 = np.dot(W2, z1)
        y = sigmoid(a2)
        
        e = D[idx] - y
        delta = y * (1-y) * e
        
        e1 = W2 * delta
        delta1 = z1 * (1-z1) * e1

        dw1 = alpha * delta1
        dw1 = dw1.reshape(4,1)
        x = k.reshape(1,3)
        W1 += np.dot(dw1, x)
        
        dw2 = alpha * delta * z1
        W2 += dw2
        idx+=1

        
def Train(epoch, x, y, W1, W2):
    for ep in range (epoch):
        DeltaSGD(W1, W2, x, y)

        
def main():
    W1 = np.random.randn(4,3)
    W2 = np.random.randn(4)
    x = np.array([[0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
    y = np.array([0, 1, 1, 0])
    trainCount = 10000

    print('---Before Training---')
    print(W1)
    print(W2)
    print('---After Training---')
    Train(trainCount, x, y, W1, W2)
    print(W1)
    print(W2)
    
    print('---Result---')
    for k in x:
        a1 = np.dot(W1, k)
        z1 = sigmoid(a1)
        
        a2 = np.dot(W2, z1)
        y = sigmoid(a2)
        print(y) 
        
        
if __name__ == '__main__':       
    main()        
---Before Training---
[[-0.82542712 -0.65157477  0.09131077]
 [-0.12367401  1.07601221 -1.43941252]
 [-1.00401084 -0.04547823  0.97194216]
 [ 0.02719329 -0.22932678 -0.45809196]]
[ 0.16840571 -0.55206913  1.75255171 -0.54203599]
---After Training---
[[-6.3608461  -6.35976778  2.71126418]
 [ 3.61918383  3.62562196 -5.65337702]
 [-3.70117648 -3.70158904  5.76910815]
 [-1.51981715 -1.56682777 -0.58710802]]
[-11.12882426  -6.71646542   6.50908732  -1.52377049]
---Result---
0.01083108954199271
0.9896067125952175
0.9895881791368779
0.01040259419256147

 

'Coding > Python 삽질기' 카테고리의 다른 글

[Pygame] Paper Plane Game 만들기  (0) 2020.08.25
[Python][AI] Perceptron 예제  (0) 2020.07.28
[Python] fisher-yates shuffle  (0) 2020.07.20
Posted by chobocho
Coding/Python 삽질기2020. 7. 28. 23:56

 

import numpy as np

def sigmoid(x):
    return 1/(1+np.exp(-x))


def DeltaSGD(W, X, D):
    alpha = 0.9
    dwSum = np.array([0] * 3)
    
    idx = 0
    for k in X:
        a1 = np.dot(k, W)
        y = sigmoid(a1)
        
        e = D[idx] - y
        delta = y * (1-y) * e
        
        dw = alpha * delta * k
        W += dw
        idx+=1

        
def Train(epoch, x, y, W1):
    for ep in range (epoch):
        DeltaSGD(W1, x, y)

        
def main():
    W1 = np.random.randn(3)
    x = np.array([[0, 0, 1], [0, 1, 1], [1, 1, 1], [1, 0, 0]])
    y = np.array([1, 1, 1, 0])

    Train(10000, x, y, W1)
    
    for k in x:
        a1 = np.dot(k, W1)
        z1 = sigmoid(a1)
        print(z1)    
        
        
if __name__ == '__main__':       
    main()  

 

0.9962960119369554
0.9999259998523653
0.9929612087250037
0.010332095384834877

'Coding > Python 삽질기' 카테고리의 다른 글

[Python][AI] XOR 예제  (0) 2020.08.03
[Python] fisher-yates shuffle  (0) 2020.07.20
강아지 나이 계산기  (0) 2020.07.16
Posted by chobocho