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
#include <pybind11/embed.h> // everything needed for embedding | |
#include <iostream> | |
namespace py = pybind11; | |
void say_hello() { | |
py::print("Hello, World!"); // use the Python API | |
} | |
void exec_py_code() { |
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
""" | |
Exercise for tensorflow.contrib.slim | |
model Reference:http://arakan-pgm-ai.hatenablog.com/entry/2017/11/23/080000 | |
""" | |
import tensorflow as tf | |
import tensorflow.contrib.slim as slim | |
from tensorflow.examples.tutorials.mnist import input_data | |
from contextlib import ExitStack |
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
""" | |
Main Reference: | |
https://qiita.com/ceptree/items/c547116bda4a5db11596 | |
""" | |
import numpy as np | |
from matplotlib import pyplot as plt | |
def update(event_hanlder): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
Usage: | |
$ pip install bokeh | |
$ bokeh serve --show triangle.py | |
Then your web browser starts. Enjoy! | |
""" | |
import math | |
import numpy as np |
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
# https://www.juliabox.com/notebook/notebooks/tutorials/intro-to-julia/09.%20Julia%20is%20fast.ipynb | |
using PyCall | |
using Libdl | |
py""" | |
def pysum(arr): | |
s=0 | |
for a in arr: | |
s+=a |
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
using InteractiveUtils | |
using BenchmarkTools | |
using PyCall | |
versioninfo() | |
a = rand(10^7) # 1D vector of random numbers, uniform on [0,1) | |
function mysum(arr) | |
s = 0.0 |