Skip to content

Instantly share code, notes, and snippets.

View kojix2's full-sized avatar
🔬
🧬 🖥️ ♋

kojix2

🔬
🧬 🖥️ ♋
View GitHub Profile
@kojix2
kojix2 / mnist-cnn.rb
Created March 27, 2018 23:20
red-chainer mnist-cnn sample
require 'chainer'
require 'fileutils'
require 'tmpdir'
C = Chainer
CT = C::Training
CI = C::Iterators
CTE = CT::Extensions
class CNN < C::Chain
@kojix2
kojix2 / salesman.rb
Last active April 30, 2018 14:07
salesman.rb
require 'tk'
#セールスマンの人数
SALESMEN = 300
#ポイントの数
POINTS = 30
#世代数
LASTG = 1000
#キャンバスの横幅
WIDTH = 300
@kojix2
kojix2 / file0.rb
Last active December 9, 2018 09:36
Rubyでメニューバーを作る ref: https://qiita.com/kojix2/items/525f31f9e61158ec691f
require 'gtk3'
def on_shimane_clicked
puts "島根県が選択されました"
end
b = Gtk::Builder.new(file: "sample.glade")
w = b.get_object "win"
b.connect_signals{|handler| method(handler)}
w.signal_connect(:destroy){Gtk.main_quit}
@kojix2
kojix2 / hoge.rb
Last active December 12, 2018 08:00
require 'datasets-gdk-pixbuf'
require 'gtk3'
n = ARGV[0].to_i
w = Gtk::Window.new
w.set_size_request(600,600)
flowbox = Gtk::FlowBox.new
flowbox.valign = :start
flowbox.selection_mode = :none
require 'benchmark'
require 'matrix'
require 'numo/narray'
require 'cumo'
SIZE = 2000
NUM = 1000
Xumo = [Numo, Cumo]
Types = %i[UInt8 Int32 SFloat]
@kojix2
kojix2 / ruby.ipynb
Created February 1, 2019 10:14
ruby.ipynb
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.
@kojix2
kojix2 / Usage of DataFrame.ipynb
Created February 28, 2019 08:34
Usage of DataFrame.ipynb
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.
require 'pycall'
require 'pycall/import'
include PyCall::Import
require 'matplotlib/iruby'
Matplotlib::IRuby.activate
pyimport :pandas, as: :pd
pyimport :seaborn, as: :sns