This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch as th | |
""" | |
Author: Josue N Rivera (github.com/wzjoriv) | |
Date: 7/3/2021 | |
Description: Snippet of various clustering implementations only using PyTorch | |
Full project repository: https://github.com/wzjoriv/Lign (A graph deep learning framework that works alongside PyTorch) | |
""" | |
def random_sample(tensor, k): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
""" | |
Author: Josue N Rivera | |
Date: 1/31/2020 | |
Description: Script to organize blackboard assignment submission attempts into folders after download | |
To run: Move script to folder with attempts, then type in terminal ``python organize.py`` | |
Project Link: https://github.com/wzjoriv/wzjoriv/tree/master/scripts/blackboard | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, re | |
""" | |
Author: Josue N Rivera | |
Date: 4/28/2021 | |
Description: Script to retrieve attendance from zoom chat if participants type "<Present> Participant Name" in the chat | |
To run: Download the meeting chat from Zoom, then type on the terminal: ``python retrieve.py path/to/meeting_saved_chat.txt`` | |
Project Link: https://github.com/wzjoriv | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Author: Josue N Rivera | |
Date: 7/16/2024 | |
Description: Function to print a progress bar into the console given a value between 0.0 and 1.0 | |
""" | |
def progress_bar(percentage, size=100, end=False, fill_char='|'): | |
percentage = max(0.0, min(1.0, percentage)) # clamp to range [0.0, 1.0] | |
percentage_int = int(percentage*100) # convert to integer percentage | |
count = int(percentage*size) # determine number of characters to fill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch as th | |
""" | |
Author: Josue N Rivera | |
Date: 8/22/2024 | |
Description: Function to generate sawtooth wave only using PyTorch | |
""" | |
def sawtooth_wave(t, period = 0.5, amplitude = 1.0, phase = 0.0, move = 0.0): | |
x = (t + phase) / period |