Loading…
CIANNA is a general-purpose deep learning framework primarily developed and used for astronomical data analysis.
Functionalities and optimizations are added based on relevance for astrophysical problem-solving. CIANNA can be used to build and train large neural network models for various tasks and is provided with a high-level Python interface (similar to keras, pytorch, etc.).
One of the specificities of CIANNA is its custom implementation of a YOLO-inspired object detector used in the context of galaxy detection in 2D or 3D radio-astronomical data products. The framework is fully GPU-accelerated through low-level CUDA programming.
Functionalities and optimizations are added based on relevance for astrophysical problem-solving. CIANNA can be used to build and train large neural network models for various tasks and is provided with a high-level Python interface (similar to keras, pytorch, etc.).
One of the specificities of CIANNA is its custom implementation of a YOLO-inspired object detector used in the context of galaxy detection in 2D or 3D radio-astronomical data products. The framework is fully GPU-accelerated through low-level CUDA programming.
Could not load dev updates.
import numpy as np
import CIANNA as cnn
def i_ar(int_list):
return np.array(int_list, dtype="int")
def f_ar(float_list):
return np.array(float_list, dtype="float32")
data = np.fromfile("mnist_input.dat", dtype="float32")
data = np.reshape(data, (80000,28*28))
targ = np.fromfile("mnist_target.dat", dtype="float32")
targ = np.reshape(targ, (80000,10))
data_train = data[:60000,:]
data_valid = data[60000:70000,:]
targ_train = targ[:60000,:]
targ_valid = targ[60000:70000,:]
cnn.init(in_dim=i_ar([28,28]), in_nb_ch=1,
out_dim=10, bias=0.1, b_size=16,
comp_meth="C_CUDA", dynamic_load=1)
cnn.create_dataset("TRAIN", size=60000,
f_ar(data_train), f_ar(targ_train))
cnn.create_dataset("VALID", size=10000,
if_ar(data_valid), f_ar(targ_valid))
cnn.conv(f_size=i_ar([5,5]), nb_filters=8 ,
padding=i_ar([2,2]), activation="RELU")
cnn.pool(p_size=i_ar([2,2]), p_type="MAX")
cnn.conv(f_size=i_ar([5,5]), nb_filters=16,
padding=i_ar([2,2]), activation="RELU")
cnn.pool(p_size=i_ar([2,2]), p_type="MAX")
cnn.dense(nb_neurons=128, activation="RELU")
cnn.dense(nb_neurons=64 , activation="RELU")
cnn.dense(nb_neurons=10 , activation="SMAX")
cnn.train(nb_iter=20, learning_rate=0.004,
momentum=0.8, confmat=1)