Paper:
Model-based Bayesian inference of neural activity and connectivity from all-optical interrogation of a neural circuit
Population activity measurement by calcium imaging can be combined with cellular resolution optogenetic activity perturbations to enable the mapping of neural connectivity in vivo. This requires accurate inference of perturbed and unperturbed neural activity from calcium imaging measurements, which are noisy and indirect, and can also be contaminated by photostimulation artifacts. We have developed a new fully Bayesian approach to jointly inferring spiking activity and neural connectivity from in vivo all-optical perturbation experiments. In contrast to standard approaches that perform spike inference and analysis in two separate maximum-likelihood phases, our joint model is able to propagate uncertainty in spike inference to the inference of connectivity and vice versa. We use the framework of variational autoencoders to model spiking activity using discrete latent variables, low-dimensional latent common input, and sparse spike-and-slab generalized linear coupling between neurons. Additionally, we model two properties of the optogenetic perturbation: off-target photostimulation and photostimulation transients. Using this model, we were able to fit models on 30 minutes of data in just 10 minutes. We performed an all-optical circuit mapping experiment in primary visual cortex of the awake mouse, and use our approach to predict neural connectivity between excitatory neurons in layer 2/3. Predicted connectivity is sparse and consistent with known correlations with stimulus tuning, spontaneous correlation and distance.

Review:
This papers proposes an inference method of (biological) neural connectivity from fluorescence (calcium ) traces. The model includes the spiking model (GLM+low-rank factor) with an external input (optical stimulation) and a fluorescence model. The inference methods is based on variational Bayes, where the approximate posterior is modeled using a neural network. 
Novelty and originality: The methods in this paper are adequately novel and original, nicely combining various elements from previous work.
Technical issues: My main problem with this paper is that I can't really be sure that the proposed method is actually working well. It is very good that the authors tested their method on real data, but since there is no ground truth, I it is hard to estimate the quality of the inferred weights (see footnote (1) below). Given that there is no ground truth, what would really help to convince the reader that everything is working as it should, is some basic check on simulated data to show that the inferred weights are reasonably accurate. Also, it is hard to interpret Fig 5 due to its scale: how can the reader know that an improvement from 1.02 to 1.05 in the ELBO is significant? 
Clarity: The methods part seems a bit dense, with various details not completely clear from the text. I would suggest adding more complete details in the supplementary, such as the complete objective being optimized. This would also make it easier for the reader to understand the context of section 2.5. Also, from section 2.1 (e.g., lines 69-70) I thought that the weights are also treated as latent variables, and so have a recognition model. But since no recognition model is specified for the weights, so I guess I was wrong.  
Minor issues:
1) In Figure 2A, the approximate "sum of ReLU" softplus, we have c > 0, i.e. it to does not go to zero for low firing rates. Maybe using an exponential tail in that section would improve the approximation (at is still integrates with a Gaussian, and can upper bound a logistic tail). 
2) For Gaussians, the notation is supposed to be N(mu,sigma^2), not N(mu,sigma).
3) line 192: Fig 6B -> Fig 6E.
4) Figure 6 third line in caption: remove "A."
5) The index 'c' is for "cell"? This should be made clearer. 
Footnote:
(1) The authors argue that their method works since the properties of the detected weights match the expected biological statistics (Fig. 6), but this does not seem convincing. Specifically, It is a good sanity check, but these results only indicate that the method does not fail completely: it is not hard to think of cases in which we get the same properties, yet the estimate weights are highly inaccurate. For example, the observed distance dependence (Fig 6B) could be related to partial mixing of fluorescence signal of nearby neurons. With stimulation this could also be related to the "area affect" of the stimulation (Fig 6F), though this is partially compensated by the method. Similarly, the correlation of weight strength to strong Spont. and Signal. correlations might be the result that all of these factors typically increase with the firing rate of the neuron. 
%%% After authors' feedback %%%
The new results and clarifications address my concerns. I therefore have modified my score. I would like to see the limit that the correlation -> 1 on the synthetic data set in the revised paper, to make sure the method is consistent.