- Reverse the code
- Re-implment it in Rust
- Bruteforce
- ???
- Profit
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
from tensorflow.keras.layers import Input, Dense, Layer, Lambda | |
from tensorflow.keras.models import Model | |
import tensorflow.keras.backend as K | |
def setup_embrace_layer(modalities=2, num_samples=256): | |
def embrace(dockings): | |
batch_size = K.shape(dockings[0])[0] | |
# Compute the probabilities of extraction | |
selection_probabilities = tf.ones([batch_size, len(dockings)], dtype=tf.dtypes.float32) | |
probabilty_sum = tf.reduce_sum(selection_probabilities, axis=-1, keepdims=True) # [batch_size, 1] |
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
build: | |
nasm -f elf64 -o measure.o ./measure.asm | |
ld measure.o -o measure.out -lc --dynamic-linker /lib/ld-2.33.so |
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
test bench_naive_split ... bench: 2,265,338 ns/iter (+/- 136,512) | |
test bench_naive_split_no_escaping ... bench: 2,287,644 ns/iter (+/- 309,993) | |
test bench_naive_split_no_escaping_hardcoded ... bench: 2,650,552 ns/iter (+/- 27,290) | |
test bench_rust_default_split ... bench: 4,118,575 ns/iter (+/- 153,705) | |
test bench_simd_split_no_escaping ... bench: 1,707,197 ns/iter (+/- 83,440) | |
test bench_simd_split_no_escaping_hardcoded ... bench: 1,688,714 ns/iter (+/- 11,317) |
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
[package] | |
name = "bencher" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
libc = "0.2" |
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
#![feature(portable_simd)] | |
#![feature(test)] | |
extern crate test; | |
use test::{black_box, Bencher}; | |
use std::convert::TryInto; | |
use std::simd::*; | |
use std::arch::x86_64::*; | |
type Reg = f32x8; |
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 time | |
import numpy as np | |
from tqdm.auto import trange | |
import matplotlib.pyplot as plt | |
from optimizers import SGD, Momentum, Adam, Nadam | |
# Generate some data | |
positives = np.random.normal(loc=-0.3, size=1000) | |
negatives = np.random.normal(loc=0.0, size=1000) |
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 struct | |
def u32(data): | |
return struct.unpack("i", data)[0] | |
def p32(data): | |
return struct.pack("i", data) | |
class Regs: | |
IP = 0 |
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
# Version of Elastic products | |
STACK_VERSION=8.4.2 | |
# Port to expose Elasticsearch HTTP API to the host | |
ES_PORT=9200 | |
# Port to expose Kibana to the host | |
KIBANA_PORT=5601 | |
# RAM for each service 4GB |
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
#![deny(unconditional_recursion)] | |
use core::fmt::{Debug, Display, LowerHex, Binary}; | |
use core::ops::*; | |
use core::sync::atomic::*; | |
use core::num::*; | |
/// Trait of operations possible on both Signed and Unsiged words | |
pub trait Number: Sized + Send + Sync + | |
Display + LowerHex + |