Skip to content

Instantly share code, notes, and snippets.

View VictorBezak's full-sized avatar

Victor Bezak VictorBezak

View GitHub Profile
@VictorBezak
VictorBezak / NestedRecordUpdate.elm
Last active February 8, 2020 22:14
Elm -- Updating Nested Records
module Main exposing (main)
-- Record Schemas
type alias SecondLayer =
{ target_value : String }
type alias FirstLayer =
{ l2_value : SecondLayer }
@VictorBezak
VictorBezak / simpleNestedRecordUpdate.elm
Last active February 8, 2020 22:10
Simplest example of a nested record update. Only one layer deep, and one way to update.
module Main exposing (..)
import Html exposing (Html, div, section, button, text)
import Html.Attributes exposing ()
import Html.Events exposing (onClick)
import Browser exposing (sandbox)
-- Type Schemas
@VictorBezak
VictorBezak / DjKhaledSimulator.elm
Created February 8, 2020 22:05
Another nested-record update example. This time with an additional helper function that handles a second update Msg
module Main exposing (..)
import Html exposing (Html, div, section, button, text)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
import Browser exposing (sandbox)
-- Type Schemas
type alias NestedRecord =
@VictorBezak
VictorBezak / box_describe.py
Last active December 6, 2020 16:31
Box Plot Statistics
def box_describe(df_copy):
df_stats = df_copy.describe().T
df_stats.rename(columns = {
'25%': 'q1',
'50%': 'q2',
'75%': 'q3'
}, inplace = True)
df_stats['iqr'] = df_stats['q3'] - df_stats['q1']
df_stats['lower_fence'] = df_stats['q1'] - (1.5 * df_stats['iqr']) # Lower Fence
@VictorBezak
VictorBezak / grpo_demo.py
Created February 1, 2025 18:03 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset