0) # 0=red,1=green\nprint(\"trained a language grounding boundary over\",len(X),\"words\")","label":"Toy embeddings + a grounding boundary"},{"code":"# open-vocab test: words the boundary NEVER saw should still land on the right side.\nNOVEL={'ruby':([.9,0,.15,.05],0),'rose':([.85,.05,.2,0],0),'forest':([.05,.7,.1,.15],1),'mint':([0,.85,.15,.1],1)}\nok=0\nfor word,(vec,truth) in NOVEL.items():\n pred=ground(vec); print(f' \"{word}\" -> {\"green\" if pred else \"red\"}'); ok+= (pred==truth)\nassert ok==len(NOVEL), \"every novel word should ground to the correct colour\"\nprint(\"PASS - novel words ground correctly. That is open-vocabulary language, in miniature.\")","label":"Open-vocab: novel words ground correctly"}],"intro":"Ground colour words and test open-vocabulary generalization.","key":"vision-language-action/language","kind":"python","title":"Be told: ground the instruction"}">
PYTHON · NUMPY · IN-BROWSER

Be told: ground the instruction

Ground colour words and test open-vocabulary generalization.

You read

the arrays and values already in scope

You change

the code you write in each cell

Fixed

the dataset and the checks that grade you