Mar 11 2021 09:52 AM
I recently created a CartPole demo project with Bonsai. I ran the code, trained the model, evaluated the model, and then closed my browser window.
I was under the impression that Bonsai shuts down its servers in the background and suspends any further billing. However, a few days later, I received an email from Azure saying that I've exceeded my spending limit and that my Azure services have been disabled.
After looking at the Cost Analysis tab it appears that Bonsai generated $110 in charges over the 6 days after I created and evaluated my model. To the best of my knowledge, nothing should have been running during these days. However, the costs still accumulated.
I filtered the costs by the Bonsai resource group to isolate the specific charges. It appears that $84.17 was generated by log analytics and $44.63 was generated by container instances. I've included a screenshot of the cost analysis (filtered by the Bonsai resource group) for your reference.
Finally, I deleted the Bonsai resource group on Mar 3 to prevent the accumulation of additional charges. Once deleted, I was no longer charged -- as you can see from the chart in the screenshot.
Any thoughts on what would have caused this cost overrun?
Mar 11 2021 10:44 AM
Mar 11 2021 04:39 PM
Mar 11 2021 05:58 PM
Mar 12 2021 09:15 AM
Mar 12 2021 09:27 AM
Mar 12 2021 10:42 AM
In response to your other question, yes, I did modify the CartPole demo code. I created about 8 different versions of the code for various presentations. However, here's the last version that I ran:
# Reinforcement Learning with Microsoft Bonsai
# Specify the language version
inkling "2.0"
# Import libraries
using Math
using Goal
# Set the maximum angle of pole (in radians)
const MaxPoleAngle = (12 * Math.Pi) / 180
# Set the length of the cartpole track (in meters)
const TrackLength = 0.5
# Create a type that represents the agent's state
type AgentState {
cart_position: number,
cart_velocity: number,
pole_angle: number,
pole_angular_velocity: number,
}
# Create a type that represents the agent's action
type AgentAction {
command: number<-1 .. 1>
}
# Create a concept graph with a single concept to be learned
graph (input: AgentState): AgentAction {
concept BalancePole(input): AgentAction {
curriculum {
# Specify the training source is the cartpole simulator
source simulator (Action: AgentAction): AgentState {
package "Cartpole"
}
# Set the number of iterations per training episode
training {
EpisodeIterationLimit: 1000
}
# Specify the goal state as two subgoals
goal (State: AgentState) {
avoid `Fall Over`: Math.Abs(State.pole_angle) in Goal.RangeAbove(MaxPoleAngle)
avoid `Out of Range`: Math.Abs(State.cart_position) in Goal.RangeAbove(TrackLength / 2)
}
}
}
}
# Connect the simulation visualizer to the web interface.
const SimulatorVisualizer = "/cartpoleviz/"
Mar 16 2021 11:12 AM
SolutionMar 16 2021 12:32 PM