'잡동사니'에 해당되는 글 14370건

  1. 2026.05.14 QAT, PTQ .. 모델 경량화
  2. 2026.05.13 wan2.2
  3. 2026.05.13 nxp CMSIS-NN
  4. 2026.05.13 x-cube-ai 예제..?
  5. 2026.05.13 QT 창관리
  6. 2026.05.13 QString arg()
  7. 2026.05.13 openwebui 설치 시도
  8. 2026.05.13 LLM 소비전력 단상 2
  9. 2026.05.12 rag 관련 라이브러리, 방법 조사중
  10. 2026.05.12 qt 동적 크기

QAT - Quantization Aware Training

양자화 하지 않고 학습후

# Load MNIST dataset
mnist = keras.datasets.mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()

# Normalize the input image so that each pixel value is between 0 to 1.
train_images = train_images / 255.0
test_images = test_images / 255.0

# Define the model architecture.
model = keras.Sequential([
  keras.layers.InputLayer(input_shape=(28, 28)),
  keras.layers.Reshape(target_shape=(28, 28, 1)),
  keras.layers.Conv2D(filters=12, kernel_size=(3, 3), activation='relu'),
  keras.layers.MaxPooling2D(pool_size=(2, 2)),
  keras.layers.Flatten(),
  keras.layers.Dense(10)
])

# Train the digit classification model
model.compile(optimizer='adam',
              loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
              metrics=['accuracy'])

model.fit(
  train_images,
  train_labels,
  epochs=1,
  validation_split=0.1,
)

 

양자화 모델로 변환하고, 파인튜닝

import tensorflow_model_optimization as tfmot

quantize_model = tfmot.quantization.keras.quantize_model

# q_aware stands for for quantization aware.
q_aware_model = quantize_model(model)

# `quantize_model` requires a recompile.
q_aware_model.compile(optimizer='adam',
              loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
              metrics=['accuracy'])

q_aware_model.summary()

train_images_subset = train_images[0:1000] # out of 60000
train_labels_subset = train_labels[0:1000]

q_aware_model.fit(train_images_subset, train_labels_subset,
                  batch_size=500, epochs=1, validation_split=0.1)

[링크 : https://www.tensorflow.org/model_optimization/guide/quantization/training?hl=ko]

 

PTQ - Post Training Quantization

[링크 : https://www.tensorflow.org/model_optimization/guide/quantization/post_training?hl=ko]

 

pruning - 0에 가까운 애들 없애기 (가지치기)

quantization (양자화)

distillation (증류)

low rank factorization (NxM -> Xxk kxM)

[링크 : https://u-b-h.tistory.com/13]

[링크 : https://asidefine.tistory.com/318]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

VAD - PaDiM, Patchcore - 정상이 아님을 탐지  (0) 2026.05.19
U-net, segmentation  (0) 2026.05.14
unet  (0) 2026.05.06
keras - transfer learning / fine tuning  (0) 2025.09.17
keras ssd mobilenet  (0) 2025.09.16
Posted by 구차니

comfyui 보다가 동영상 만드는거에서 보이는 wan2.2 라는 키워드

이것도 알리바바 쪽 꺼라서 로고가 qwen이랑 같군.

[링크 : https://github.com/Wan-Video/Wan2.2]

[링크 : https://www.youtube.com/watch?v=sGZk2StxHho]

 

teacache 쓰면 빨리진다고 하는데..

[링크 : https://www.internetmap.kr/entry/TeaCache-with-Flux-GGUF-and-HunyuanVideo]

    [링크 : https://www.reddit.com/r/StableDiffusion/comments/1jllera/anyone_know_how_to_run_wan_21_on_a_gtx_1080ti/?tl=ko]

 

근데.. 파스칼은 안보이고 볼타부터 보이네.. 흐규흐규

[링크 : https://github.com/komikndr/raylight]

[링크 : https://github.com/pollockjj/ComfyUI-MultiGPU]

[링크 : https://github.com/robertvoy/ComfyUI-Distributed]

[링크 : https://github.com/Comfy-Org/ComfyUI/pull/7063]

    [링크 : https://www.reddit.com/r/comfyui/comments/1opv1t1/multi_gpu_support_for_video_generation_with_wan_22/]

Posted by 구차니
embeded/i.mx 8m plus2026. 5. 13. 17:48

cortex-M 을 위한 CMSIS-NN 예제 라고 해야하나?

아무튼 먼가.. 드럽네 -_-

그나저나 웨이트는.. 어떻게 펌웨어 안에 넣지?

 

[링크 : https://www.nxp.com/docs/en/application-note/AN12781.pdf]

[링크 : https://www.nxp.com/design/design-center/software/eiq-ai-development-environment/eiq-for-arm-cmsis-nn:eIQArmCMSISNN]

'embeded > i.mx 8m plus' 카테고리의 다른 글

eiq-portal로 학습 시도(cpu)  (0) 2026.05.27
g2d_surface g2d_blit()  (0) 2026.02.10
eiq 모델 정리  (0) 2025.09.16
eiq 데이터 구조  (0) 2025.09.05
ubuntu 22.04 + cuda + cudnn 설치  (0) 2025.09.04
Posted by 구차니
embeded/Cortex-M7 STM2026. 5. 13. 17:35

'embeded > Cortex-M7 STM' 카테고리의 다른 글

srec_cat 해봄  (0) 2026.05.22
stm32h757 링커 스크립트  (0) 2026.03.13
stm32h757 메모리(SRAM) 구조  (0) 2026.03.13
stm32f7 dual bank flash  (0) 2026.02.03
stm32f746g-disco with semtech sx1276 and lvgl  (0) 2026.02.03
Posted by 구차니
Programming/qt2026. 5. 13. 15:24

show() 보이기

hide() 숨기기

raise() 가장 위로 창 옮기기

activateWindow() 윈도우 기준 입력 활성화(포커스)

setFocus() 위젯 기준 입력 활성화

'Programming > qt' 카테고리의 다른 글

QT 런타임중 언어 변경  (0) 2026.05.14
QT QMainWindow, QWidget, QDialog  (0) 2026.05.14
QString arg()  (0) 2026.05.13
qt 동적 크기  (0) 2026.05.12
QT QPushButton 의 텍스트 폰트 / 색상 변경하기  (0) 2026.05.11
Posted by 구차니
Programming/qt2026. 5. 13. 14:15

cstring에서는 없는것 같은데. 어떻게 보면 python 스타일과 비슷한

인자를 받아서 포맷팅하는 방법이 존재한다.

 

int i;                // current file's number
int total;            // number of files to process
QStringView fileName; // current file's name

QString status = QString("Processing file %1 of %2: %3")
                .arg(i).arg(total).arg(fileName);

[링크 : https://norux.me/33]

[링크 : https://doc.qt.io/qt-6/qstring.html#arg]

'Programming > qt' 카테고리의 다른 글

QT QMainWindow, QWidget, QDialog  (0) 2026.05.14
QT 창관리  (0) 2026.05.13
qt 동적 크기  (0) 2026.05.12
QT QPushButton 의 텍스트 폰트 / 색상 변경하기  (0) 2026.05.11
qt5 창 내용 바꾸기  (0) 2026.05.07
Posted by 구차니

음.. 장렬히 실패 ㅋㅋ

[링크 : https://blog.oriang.net/69]

 

응 안 돼 돌아가~ 구글 ai 답변으로는 파이썬 3.11이 필요하다고

$ pip3 install open-webui
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement open-webui (from versions: none)
ERROR: No matching distribution found for open-webui

$ python3 --version
Python 3.10.12

[링크 : https://docs.openwebui.com/getting-started/quick-start/]

    [링크 : https://docs.openwebui.com/getting-started/]

 

귀찮으니 docker로 하는데 실행된다고 바로 접속되는게 아니라 좀 기다려야 하네

좌측 하단에 계정 눌러서 Settings 들어가고

 

좌측 하단에 작게 Admin Settings.. 어우 -_-

아무튼 Admin 설정으로 가야지 api 연결할 수 있다.

 

관리자 메뉴에서 connections 가면 이제 api 들이 보이는데

 

http://localhost:8080/v1 해도 되고. 아무튼 로컬에서는 llama-swap 으로 돌리는 중

 

api.openai.com은 일단 끄고 save

 

그러니까 llama-swap에서 설정된 모델들이 쭈욱 끌려나온다.

Areana model 하면 여러개 모델 싸워보게 하나본데 메모리 부족하니 일단 패스

 

위에서 인텔의 역사 인터넷 검색하라는데 그건 안된다고 하고

자기가 가진 정보로 답변하고 나서 다른거 하다가 뒤늦게(!) follow up 이라는게 뜬다. 왜 gpu가 계속 먹고 있나 했네..

 

클릭하면 바로 질문으로 넘어간다.

 

google PSE(programmable Search Engine)을 사용하면 인터넷 검색이 가능하다고 한다. 기본값으로는 안되겠군.

[링크 : https://wikidocs.net/307842]

 

 

+

대화창에 직접 url을 때려 넣으면 되는것 같기도 한데

 

주소를 직접 넣어주고

 

먼가 끌어오길 기다리면

 

저렇게 text로 들어간다. 음.. 이걸 웹 검색이라고 해줘야 하나 말아야 하나..

 

31 초 보다는 한참 더 오래 걸린거 같은디..

그 와중에 아까 했던 다음 검색 링크는 왜 들어가이는거냐 -_-

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

gpt님 만세! - pip torch 버전 낮추기  (0) 2026.05.15
wan2.2  (0) 2026.05.13
LLM 소비전력 단상  (2) 2026.05.13
rag 관련 라이브러리, 방법 조사중  (0) 2026.05.12
stable diffusion 모델 변경(SD -> SDXL)  (0) 2026.05.12
Posted by 구차니

음.. 메모리 사용량과 최대 소비전력을 곱하니 지금 드시는 소비전력이랑 얼추 비슷하게 나오는 느낌.

Stable Diffusion은 먹는 메모리 대비로는 많이 GPU를 굴릴수 있는데 (250W 를 가끔 초과하거나 근접하게 돌림)

사용중인 모델은 gemma4-e4b 이긴 한데  어떻게 저렇게 우연이라도 얼추 맞게 나오지?

 

Posted by 구차니

DB : postgres, VectorDB : pgvector

embedding

[링크 : https://github.com/gulcin/pgvector-rag-app]

    [링크 : https://edbkorea.com/blog/postgres-및-pgvector가-포함된-rag-앱/]

import PyPDF2
import torch
from transformers import pipeline

def generate_embeddings(tokenizer, model, device, text):
    inputs = tokenizer(
        text, return_tensors="pt", truncation=True, max_length=512
    ).to(device)
    with torch.no_grad():
        outputs = model(**inputs, output_hidden_states=True)
    return text, outputs.hidden_states[-1].mean(dim=1).tolist()


def read_pdf_file(pdf_path):
    pdf_document = PyPDF2.PdfReader(pdf_path)

    lines = []
    for page_number in  range(len(pdf_document.pages)):
        page = pdf_document.pages[page_number]

        text = page.extract_text()

        lines.extend(text.splitlines())

    return lines

[링크 : https://github.com/gulcin/pgvector-rag-app/blob/master/embedding.py]

[링크 : https://github.com/gulcin/pgvector-rag-app/blob/master/commands/import_data.py]

 

langchain, kure(임베딩 벡터 생성)

fast api, streamlit

[링크 : https://lsjsj92.tistory.com/686]

     [링크 : https://huggingface.co/nlpai-lab/KURE-v1]

 

ChromaDB, langchain

DB : postgres, VectorDB : pgvector

[링크 : https://velog.io/@judy_choi/PGVector-와-프롬프트를-이용한-RAG-고도화]

Posted by 구차니
Programming/qt2026. 5. 12. 14:15

MainWindow에 하나의 QLabel만 있다면

MainWindow - Lay out - Lay Out Horizontally / Vertically 중에 아무거나

QLabel 에서 scaledContents 체크해주면 끝

 

'Programming > qt' 카테고리의 다른 글

QT 창관리  (0) 2026.05.13
QString arg()  (0) 2026.05.13
QT QPushButton 의 텍스트 폰트 / 색상 변경하기  (0) 2026.05.11
qt5 창 내용 바꾸기  (0) 2026.05.07
qt QPushButton 에서 이미지로 대체하기 (hover)  (0) 2026.04.29
Posted by 구차니