• 418_im_a_teapot@sh.itjust.works
    link
    fedilink
    arrow-up
    10
    ·
    21 hours ago

    We could probably improve on that significantly without losing speed.

    return $x < 8
    

    That should yield one additional correct answer, while also confusing anyone who thinks it just returns false.

    And if we just hard coded and checked the first 20 or so primes before always returning false, we would probably get noticeable improvement (depending on the total range).

  • HiddenLayer555@lemmy.ml
    link
    fedilink
    English
    arrow-up
    14
    ·
    23 hours ago

    Just put “Precondition: x must not be prime” in the function doc and it’ll be 100% accurate. Not my fault if you use it wrong.

    • idriss@lemmy.ml
      link
      fedilink
      arrow-up
      6
      ·
      20 hours ago

      A similar experiment I did comes to mind from 3 years ago.

      For the fun of it I was trying to train a few deep neural network configurations (LSTM, a few variations of FCNs, …) to trade shitcoins and downloaded 4 years of 1h candles.

      The first easiest idea was to prepare the training data to fire three signals, buy, sell, do nothing (I know a terrible choice). The cost function was setup to do the simple thing and maximize the overall profit (I know an other terrible choice). Fast forward 30min of training and the final outcome is a model that outputs “do nothing” in 100% of the cases.

      • MonkeMischief@lemmy.today
        link
        fedilink
        arrow-up
        6
        ·
        18 hours ago

        Fast forward 30min of training and the final outcome is a model that outputs “do nothing” in 100% of the cases.

        To be fair, your program demonstrated the most reliable way to win at crypto! 😉

  • idriss@lemmy.ml
    link
    fedilink
    arrow-up
    31
    ·
    1 day ago

    I am screenshoting this so it will be screenshot of a screenshot of a screenshot then post it somewhere else

    • Couldbealeotard@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      24 hours ago

      The output is not the output of the algorithm, it’s the output of the unit test.

      95% of numbers up to that point at not prime. Testing the algorithm that only says “not prime” is therefore correct 95% of the time. The joke is that, similar to AI, the algorithm is being presented as a useful tool because it’s correct often but not always.

    • Carl [he/him]@hexbear.net
      link
      fedilink
      English
      arrow-up
      16
      ·
      edit-2
      1 day ago

      that’s the joke, since most numbers aren’t prime, this function is technically highly accurate despite being completely useless.

    • anton@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      6
      ·
      1 day ago

      The test suite probably looks something like this:

      int tests_passed=0;
      int tests_failed=0;
      for(int i=0;i<100000;i++){
          printf("test no. %d: ", i);
          if(is_prime(i)==actually_is_prime(i)){
              printf("passed\n");
              tests_passed++;
          }else{
              printf("failed\n");
              tests_failed++;
          }
      }
      //...
      
    • Jankatarch@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      23 hours ago

      “AI models have started training other AI models, by pressing The-Button-That-Trains-AI-models; this button was built 7 years ago by a bunch of online volunteers we won’t ever credit.”

  • anton@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    2
    ·
    1 day ago

    The test suite probably looks something like this:

    int tests_passed=0;
    int tests_failed=0;
    for(int i=0;i<100000;i++){
        printf("test no. %d: ", i);
        if(is_prime(i)==actually_is_prime(i)){
            printf("passed\n");
            tests_passed++;
        }else{
            printf("failed\n");
            tests_failed++;
        }
    }
    //...