Question: I'm using a jsonb field in my Rails application and have installed the [gem attr\_json](https://github.com/jrochkind/attr_json). Is there a way to receive the defined json\_attributes programmatically? With a "normal" rails attribute, I would just do @instance.attribute\_names. But with attr\_json is there any way how to have the json\_attributes returned? 

```
class Vehicle < Item
  include AttrJson::Record

  attr_json :licence_plate, :string, container_attribute: "custom_attributes_indexed"
  attr_json :brand, :string, container_attribute: "custom_attributes_indexed"
  attr_json :serial_number, :string, container_attribute: "custom_attributes_indexed"
  attr_json :inventory_number, :string, container_attribute: "custom_attributes_indexed"
end

```

For this code I would like to do something like @vehicle.json\_attribute\_names and have the following returned

```
["licence_plate", "brand", "serial_number", "inventory_number"]

```

Answer: 
I think you should clear your previous model inside loop so you could use this function which is keras.backend.clear\_session().From <https://keras.io/backend/>: 
This will be solved your problem.
From a very simplistic point of view, the data is fed in sequentially, which suggests that at the very least, it's possible for the data order to have an effect on the output. If the order doesn't matter, randomization certainly won't hurt. If the order does matter, randomization will help to smooth out those random effects so that they don't become systematic bias. In short, randomization is cheap and never hurts, and will often minimize data-ordering effects.

In other words, when you feed your neural network with different datasets, your model can get biased towards the latest dataset it was trained on. 

You should always make sure that your are randomly sampling from all datasets you have.