목록분류 전체보기 (133)
토니의 연습장
LangChain과 LangSmith는 모두 언어 모델의 기능을 확장하고 응용하는 데 도움을 주는 도구이지만, 목적과 기능에서 차이가 있습니다.1. LangChainLangChain은 대화형 AI 응용 프로그램을 구축하기 위한 프레임워크입니다. 주요 목적은 다양한 자연어 처리(NLP) 및 대화형 AI 애플리케이션을 쉽게 설계, 개발, 실행할 수 있도록 지원하는 것입니다.LangChain의 주요 특징:프롬프트 관리: 프롬프트를 재사용 가능하게 정의하고 템플릿화할 수 있습니다.메모리 관리: 대화 기록을 기억하고 관리하는 기능을 제공합니다.Tooling과 Agents: 언어 모델이 특정 API 또는 데이터베이스와 상호작용할 수 있도록 도와주며, 다양한 외부 툴을 언어 모델과 결합할 수 있는 에이전트를 지원합니..
1. CLIP 필요 패키지 확인 (https://github.com/openai/CLIP/blob/main/requirements.txt)requirements.txt 파일 위치시키기ftfypackagingregextqdmtorchtorchvision 2. taming-transformers 필요 패키지 확인 (https://github.com/CompVis/taming-transformers/blob/master/environment.yaml)envrionment.yaml 파일 위치시키기name: tamingchannels: - pytorch - defaultsdependencies: - python=3.8.5 - pip=20.3 - cudatoolkit=10.2 - pytorch=1.7.0 - tor..
[ Wasserstein GAN ]1. 배경 : 기존 basicGAN의 문제점(1) Mode Collapse (2) BCE Loss 문제점 (gradient) 2. 해결 : Wasserstein Loss 3. 추가적용 : Critic의 gradient가 너무 커지지 않도록 1-lipschitz 연속성 조건 도입(critic)아래와 같이 두 가지 방안 중에 Weight Clipping은 좋지 않은 방법으로, Gradient penalty가 적용됩니다.이 때, 현실적으로 매번 gradient를 계산할 수 없으므로 real과 fake의 interpolated mix를 통해 이를 gp equation에 위와 같이 대입함으로써 gradient penalty를 계산합니다. (gradient의 norm에서 1을 뺀 ..
# For nn.Conv2d: (reduce the size of the image for prediction : Discriminator)output_size = (n + 2 * pad - ks) // stride + 1 # For nn.ConvTranspose2d: (grow from a value to full image for generation : Generator)output_size = (n - 1) * stride - 2 * padding + ks
https://www.acmicpc.net/problem/2559N, K = list(map(int, input().split()))A = list(map(int, input().split()))# 누적합psum = [0]*Npsum[0] = A[0]for i in range(1,N): psum[i] = psum[i-1]+A[i] # 연속된 K일 온도합temp_sum = []for i in range(0,N-K+1): # i ~ i+K-1 if i==0: sum=psum[i+K-1] else: sum=psum[i+K-1]-psum[i-1] temp_sum.append(sum)print(max(temp_sum)) https://www...
로컬에서 환경 구성해서 모델 다운로드 및 파인튜닝 하고자 할 때,python 및 pytorch, CUDA, CUDA Toolkit 등 버전 매칭 관련하여vscode에서 conda 환경의 Python Environments.. 를 Python Interpreter.. 각각에 대해서 확인이 필요합니다. 예시 :%%capture# Installs Unsloth, Xformers (Flash Attention) and all other packages!!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"!pip install --no-deps "xformersfrom unsloth import FastLanguageMod..
https://www.acmicpc.net/problem/11399 두 가지 주요사항:1. 무엇을 선택할지 : 각 순서에 누구를 배치할지2. 어떤 순서로 선택할지 : 앞 또는 뒤에서부터 누구를 배치할지 -> 뒤에서부터 배치N = int(input())P = list(map(int, input().split()))P = sorted(P)total = 0for i in range(N): total += sum(P[:i+1]) print(total) https://www.acmicpc.net/problem/2847 두 가지 주요사항:1. 무엇을 선택할지 : 각 레벨의 보상을 몇으로 할지2. 어떤 순서로 선택할지 : 높은 레벨부터 보상 값을 결정하는 방향 N = int(input())L = [0]*..
