This file contains 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
#include <print> | |
#include <tuple> | |
consteval auto Vector(int x, int y) { | |
auto getX = [x] consteval {return x;}; | |
auto getY = [y] consteval {return y;}; | |
auto add = [x, y](auto other) consteval { | |
const auto [otherX, otherY, _] = other; |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
struct Node { | |
int data; | |
struct Node *next; | |
struct Node *prev; | |
}; | |
void printList(struct Node *node) { |
This file contains 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 cv2 | |
import matplotlib.pyplot as plt | |
face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_default.xml') | |
profile_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_profileface.xml') | |
plate_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_russian_plate_number.xml') | |
def blur_regions(image, regions): | |
for (x, y, w, h) in regions: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
""" | |
A simple decision tree implementation in scikit-learn. | |
Trained on fabricated malware data. | |
Features: file id, name, size in MB, extension and executability. | |
Labels: malware or not. | |
Output: | |
Accuracy: 0.75 |
This file contains 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
""" | |
A simple implementation of L1 unstructured pruning. | |
Uses the magnitude of the weights to determine which weights to prune. | |
Made for the purpose of understanding pruning. | |
Built on top of the scikit-learn MLPClassifier. | |
Trained on the MNIST (28 x 28) dataset. | |
Output: | |
Accuracy before pruning: 0.901 |