Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coordinated Machine Learning for Channel Reuse and Transmission Power Allocation for D2D Communication
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mobile and Wireless
Codes
Publications
Coordinated Machine Learning for Channel Reuse and Transmission Power Allocation for D2D Communication
Commits
5c2d8fb9
Commit
5c2d8fb9
authored
8 months ago
by
Ishtiaq Ahmad
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
291f1bb6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
update_critic.m
+14
-0
14 additions, 0 deletions
update_critic.m
with
14 additions
and
0 deletions
update_critic.m
0 → 100644
+
14
−
0
View file @
5c2d8fb9
function critic = update_critic(actornet, critic, batch, critic_lr, gamma,fed_loss)
states = cat(1, batch.state);
rewards = cat(1, batch.reward);
next_states = cat(1, batch.next_state);
action = select_action(actornet, next_states);
target_next_Q_values = predict(critic, dlarray(next_states,'BC'),action);
rewards = reshape(rewards, [],size(target_next_Q_values,2));
target_Q_values = rewards + gamma .* target_next_Q_values;
target_Q_values = reshape(target_Q_values, 1,[]);
averageGrad = [];
averageSqGrad = [];
critic_gradients = gradient_critic(critic, dlarray(states,'BC'), action,fed_loss,target_Q_values);
critic = adamupdate(critic, critic_gradients,averageGrad,averageSqGrad,1000,critic_lr);
end
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment