Added type casts needed for GPU.
- the GPU required a number of parameters to be explicitly cast to float32
- also added a scale parameter to connections