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
# compile | |
$ g++ zlib-example.cpp -lz -o zlib-example | |
# run | |
$ ./zlib-example | |
Uncompressed size is: 36 | |
Uncompressed string is: Hello Hello Hello Hello Hello Hello! | |
---------- |
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 <iostream> | |
#include <cstdarg> | |
#include <string> | |
#include <fstream> | |
#include <memory> | |
#include <cstdio> | |
std::string exec(const char* cmd) { | |
std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose); | |
if (!pipe) return "ERROR"; |
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 numpy as np | |
def sigmoid(x): | |
return 1 / (1 + np.exp(-x)) | |
def neural_network(X, y): | |
learning_rate = 0.1 | |
W1 = np.random.rand(2, 4) | |
W2 = np.random.rand(4, 1) |