def update_links(links, value):
for h, w in links:
table[h][w][0] = value
def init_links(links):
for h, w in links:
table[h][w] = ['EMPTY', {(h, w)}]
def update(command):
if len(command) == 3:
h, w, value = command
h, w = int(h) - 1, int(w) - 1
_, links = table[h][w]
update_links(links, value)
else:
value1, value2 = command
for h in range(n) :
for w in range(n) :
value, links = table[h][w]
if value == value1 : table[h][w][0] = value2
def merge(command):
h1, w1, h2, w2 = map(int, command)
if h1 == h2 and w1 == w2 : return
h1, w1, h2, w2 = h1-1, w1-1, h2-1, w2-1
value1, links1 = table[h1][w1]
value2, links2 = table[h2][w2]
links = links1.union(links2)
value = value1 if value1 != "EMPTY" else value2
update_links(links, value)
for h, w in links :
table[h][w][1] = links
def unmerge(command):
h, w = map(int, command)
h, w = h - 1, w - 1
value, links = table[h][w]
init_links(links)
table[h][w][0] = value
def print_(command):
h, w = map(int, command)
h, w = h - 1, w - 1
value, _ = table[h][w]
return value
# ํ
์ด๋ธ ๋ฐ value_storage ์ด๊ธฐํ
n = 50
table = [[["EMPTY", {(h, w)}] for w in range(n)] for h in range(n)]
def solution(commands):
answer = []
for command in commands:
command_type, values = command.split(' ', 1)[0], command.split(' ')[1:]
if command_type == 'UPDATE':
update(values)
elif command_type == 'MERGE':
merge(values)
elif command_type == 'UNMERGE':
unmerge(values)
elif command_type == 'PRINT':
answer.append(print_(values))
return answer
def expand_bin(bin_number) :
i = 0
while len(bin_number) > 2**(i+1) - 1 :
i += 1
return '0'*(2**(i+1) - 1 - len(bin_number)) + bin_number
def possiblity_check(bin_number) :
center = len(bin_number) // 2
if len(bin_number) == 1 :
return True
elif bin_number[center] == '0' :
return not ('1' in bin_number[:center] or '1' in bin_number[center + 1:])
else:
return possiblity_check(bin_number[:center]) and possiblity_check(bin_number[center + 1:])
def solution(numbers):
answer = []
for number in numbers :
bin_number = str(bin(number))[2:]
bin_number = expand_bin(bin_number)
answer.append(possiblity_check(bin_number)*1)
return answer
def solution(cap, n, deliveries, pickups):
deliveries.reverse()
pickups.reverse()
answer = 0
have_to_deli = 0
have_to_pick = 0
for i in range(n):
have_to_deli += deliveries[i]
have_to_pick += pickups[i]
while have_to_deli > 0 or have_to_pick > 0:
have_to_deli -= cap
have_to_pick -= cap
answer += (n - i) * 2
return answer
from itertools import product
import heapq
def solution(users, emoticons):
discount_rates = [0.1, 0.2, 0.3, 0.4]
discount_combinations = product(discount_rates, repeat=len(emoticons))
results = []
for discounts in discount_combinations:
total_cost = 0
num_membership = 0
for hope_discount, payment in users:
cost_for_user = sum(emoticon * (1 - discount) for emoticon, discount in zip(emoticons, discounts) if hope_discount <= discount * 100)
if payment <= cost_for_user:
num_membership += 1
else:
total_cost += cost_for_user
heapq.heappush(results, (-num_membership, -total_cost))
return [-x for x in heapq.heappop(results)]
๊ฐ์ธ์ ๋ณด ์์ง ์ ํจ๊ธฐ๊ฐ
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
def solution(today, terms, privacies):
terms = {term.split(' ')[0]:int(term.split(' ')[1]) for term in terms}
today = datetime.strptime(today,'%Y.%m.%d')
answer = []
for idx, info in enumerate(privacies) :
date, type = info.split(' ')
date = datetime.strptime(date,'%Y.%m.%d') + relativedelta(months=+terms[type])
if date <= today :
answer.append(idx+1)
return answer
Full Citation: โDai, Xiaoliang, et al. โEmu: Enhancing image generation models using photogenic needles in a haystack.โ arXiv preprint arXiv:2309.15807 (2023).โ
Link to Paper: https://arxiv.org/abs/2309.15807
Conference Details: Meta 2023
์์์ ์ผ๋ก ์ ํ ๋ high quality ์ด๋ฏธ์ง(highly aesthetically-pleasing)๋ text-to-image ์์ฑ ๋ชจ๋ธ์์ ์ด๋ฏธ์ง์ ๋ฏธ์ ์ฑ(aesthetics)์ ํฅ์์ํฌ ์ ์๋ค.
๋จ์ง ์๋ฐฑ์์ ์์ฒ ๊ฐ์ high quality ์ด๋ฏธ์ง๋ฅผ fine-tuningํ๋ฉด ์์ฑ๋ ์ด๋ฏธ์ง์ ์๊ฐ์ ๋งค๋ ฅ์ด ํฅ์๋๋ค.
์ด๋ฌํ quality-tuning์ Latent Diffusion Model(LDM)๋ฟ๋ง ์๋๋ผ Pixel Diffusion ๋ฐ masked generative transformer models์๋ ํจ๊ณผ๊ฐ ์๋ค.
Full Citation: โMukhopadhyay, Soumik, et al. โDiff2Lip: Audio Conditioned Diffusion Models for Lip-Synchronization.โ arXiv preprint arXiv:2308.09716 (2023).โ
Link to Paper: https://arxiv.org/pdf/2308.09716.pdf
Conference Details: arXiv 2023
Project Page: Link
Lip synchronization task
Audio์ ๋ง๊ฒ ์ฌ๋์ ์ ์ ์์ง์์ ํฉ์ฑํ๋ task.
์ํ ์ฐ์ (๋๋น), ๊ฐ์ ์๋ฐํ ๋ฑ์์ ๋ค์ํ ์์ฉ์ด ๊ฐ๋ฅํ๋ค.
๋์ ๊ณผ์
๋ํ ์ผํ ์ ์ ์์ง์ ๊ตฌํ
identity, pose, emotions ๋ฑ source์ ํน์ง์ ๋ณด์กดํด์ผํจ