tfmri.sampling.random_mask
tfmri.sampling.random_mask¶
- random_mask(shape, density=1.0, seed=None, rng=None, name=None)[source]¶
- Returns a random sampling mask with the given density. - Parameters
- shape – A 1D integer - Tensoror array. The shape of the output mask.
- density – A - Tensor. A density grid. After broadcasting with- shape, each point in the grid represents the probability that a given point will be sampled. For example, if- densityis a scalar, then each point in the mask will be sampled with probability- density. A non-scalar- densitymay be used to create variable-density sampling masks. tfmri.sampling.density_grid can be used to create density grids.
- seed – A - Tensorof shape- [2]. The seed for the stateless RNG.- seedand- rngmay not be specified at the same time.
- rng – A - tf.random.Generator. The stateful RNG to use.- seedand- rngmay not be specified at the same time. If neither- seednor- rngare provided, the global RNG will be used.
- name – A name for this op. 
 
- Returns
- A boolean tensor containing the sampling mask. 
- Raises
- ValueError – If both - seedand- rngare specified.