Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NK_ADD #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix NK_ADD #9

wants to merge 1 commit into from

Conversation

tom-huntington
Copy link

@tom-huntington tom-huntington commented Nov 8, 2024

Some guy in the youtube comments found a bug

your sum operation is not correctly defined. According to the paper

""" All functions appearing in the RandomArt algorithm are scaled so that they map the interval [-1; 1] to the interval [-1; 1]. This condition ensures that all randomly generated expression trees are valid. For example, the scaling for the add function is achieved by defining add(x; y)=(x + y)/2
"""

This property keeps the output colour channels in [-1; 1] and thus stops clipping.

All randomart operations should map interval [-1; 1] to [-1; 1]
@ChickChicky
Copy link

ChickChicky commented Nov 8, 2024

For now it unfortunately doesn't look that nice. Instead of having interesting shapes, it's just a slightly interesting gradient 😢. Hopefully it'll be better with sine / mix / division functions.

@impossibletea
Copy link

I believe similar normalization should also be applied to NK_MULT. Multiplication normalization in that case would be sqrtf(lhs->as.number * rhs->as.number).

But this is not that much of an issue, as current implementation of NK_MULT already returns values in $[-1, 1]$.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants