menu_book Course Curriculum (Generative AI) expand_more
Model Inputs
Generation Controls
Grounding & Retrieval
Frequency penalties
Learn Frequency penalties in Generative AI with a focused explanation, a topic-specific example, and a mastery check.
12 min read
•
Beginner
Advertisement
generative-ai-015.py
python
tokens='red red blue red green'.split(); seen={}
for t in tokens: seen[t]=seen.get(t,0)+1
print({t:1/(1+c) for t,c in seen.items()})
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content