Questions tagged [chainer]

Chainer is an open source deep learning framework written in Python.

Chainer

A Powerful, Flexible, and Intuitive Framework for Neural Networks

For more info see chainer.org

194 questions
0
votes
1 answer

Error training a MLP using Chainer

I am trying to train and test a simple multi-layer perceptron, exactly as in the first Chainer tutorial, but with my own dataset instead of MNIST. This is the code I'm using (mostly from the tutorial): class MLP(Chain): def __init__(self,…
ljmanso
  • 63
  • 1
  • 4
0
votes
1 answer

How to implement a batch linear link in chainer, that supports different weights for every example in batch?

We use chainer.functions.linear to compute y=Wx+b. In my case, I have to implement a linear link with one more dimension. Say the input example is (c, x), the desired output is then y = W_c x + b. Let's ignore the bias and make it y = W_c x. The…
0
votes
2 answers

How to do outer product as a layer with chainer?

How can I include an outer product (of the previous feature vector and itself) as a layer in chainer, especially in a way that's compatible with batching?
0
votes
1 answer

What does "#NOQA" mean inside `__init__.py` file in Chainer library?

I am reading Chainer source code and noticed at https://github.com/chainer/chainer/blob/master/chainer/init.py#L7 from chainer import configuration # NOQA from chainer import cuda # NOQA from chainer import dataset # NOQA from chainer import…
Daniel
  • 1,428
  • 3
  • 16
  • 35
0
votes
1 answer

NStepLSTM and Seq2Seq model

Dear chainer community, I can't struggle the logic usage of NStepLSTM in seq2seq official example (English to French translation). def __call__(self, xs, ys): xs = [x[::-1] for x in xs] #Reverse x as far as I can understand xs is a English…
Sergey Sosnin
  • 1,313
  • 13
  • 30
0
votes
1 answer

How to use mix link Multi-CPU of parallel computing in chainer v2.1.0

In my research . I wrote 2 layers in neural network, the bottom first layer is RNN which runs on GPU, the top second layer is CPU(the algorithm model nature is more suited to CPU), I implemented it in CPU in chainer self-defined Link. But, the CPU…
machen
  • 283
  • 2
  • 10
0
votes
1 answer

How to fix layer parameter in learning network in chainer v2.0?

Suppose I have pretrained the network on other database. Because of overfitting problem, my database is not very diversity , so the overfitting problem is very serious. I want to load the pretrained network parameter in chainer v2.0 but to fix first…
machen
  • 283
  • 2
  • 10
0
votes
2 answers

How to set loss weight in chainer?

First of all I narrate you about my question and situation. I want to do multi-label classification in chainer and my class imbalance problem is very serious. In this cases I must slice the vector inorder to calculate loss function, For example, In…
machen
  • 283
  • 2
  • 10
0
votes
1 answer

How to use xavier weight initializer in chainer

I have found this page: https://docs.chainer.org/en/stable/reference/initializers.html How to use xavier weight initializer to initialize weight in chainer?
machen
  • 283
  • 2
  • 10
0
votes
2 answers

How to control input feature size/dimension in chainer?

For example, the FC layer(L.Linear) needs input_size and output_size , but this is only set for weight matrix in FC. But the input image size can be arbitrary, how to control to limit the input image size or input other feature size?
machen
  • 283
  • 2
  • 10
0
votes
1 answer

How to use multiple GPU in chainer.training.extensions.Evaluator?

because my train model is on multiple GPU, during training , I use trainer.extend to validate my model every epoch, But chainer.training.extensions.Evaluator has only one device argument, but my model network parameter is on 2 GPUs. how to validate…
machen
  • 283
  • 2
  • 10
0
votes
1 answer

How does chainer.functions.get_item back propagation exactly?

This question follows Does slice or index of chainer.Variable to get item in chainer has backward ability? Consider an typical example question : suppose I have convolutional layer + FC layer, my last FC layer output an vector. Because in some cases…
machen
  • 283
  • 2
  • 10
0
votes
1 answer

Why does NStepLSTM not have reset_state method?

I firstly use L.LSTM , then I found this NStepLSTM, which is uncovered part of offical tutorial document. https://docs.chainer.org/en/stable/reference/generated/chainer.links.NStepLSTM.html?highlight=Nstep Why does chainer.links.NStepLSTM or…
machen
  • 283
  • 2
  • 10
0
votes
0 answers

get Item/slice in chainer.Variable doesn't support multi-GPU chainer.training.ParallelUpdater?

I have 2-dimension array , When I use following code to compute loss: _roi_score = roi_score[row_index, col_index] gt_roi_label_lst = gt_roi_label_lst[row_index, col_index] loss = F.sigmoid_cross_entropy(roi_score, gt_roi_label_lst) # multi…
machen
  • 283
  • 2
  • 10
0
votes
2 answers

Adam optimizer report error in chainer?

version: chainer 2.0.2 I use Adam optimizer ,then report error, I found it was caused by this code(fix1==0?): in adam.py: @property def lr(self): fix1 = 1. - math.pow(self.hyperparam.beta1, self.t) fix2 = 1. -…
machen
  • 283
  • 2
  • 10