Skip to content

Commit a60403b

Browse files
committed
Working on Basics
1 parent c1d7be0 commit a60403b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tutorials/basics/pytorch_basics/main.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int main() {
4646
std::cout << "b: " << linear->bias << std::endl;
4747

4848
// Build loss function and optimizer
49-
auto criterion = torch::nn::MSELoss();
49+
auto criterion = torch::nn::L1Loss();
5050
auto optimizer = torch::optim::SGD(linear->parameters(), torch::optim::SGDOptions(0.01));
5151

5252
// Forward pass
@@ -72,18 +72,20 @@ int main() {
7272
std::cout << "loss after 1 step optimization: " << loss.item().toFloat() << std::endl;
7373

7474
// =============================================================== //
75-
// INPUT PIPELINE //
75+
// PRETRAINED MODEL //
7676
// =============================================================== //
7777

78-
// =============================================================== //
79-
// INPUT PIPELINE FOR CUSTOM DATASET //
80-
// =============================================================== //
78+
std::cout << std::endl << "PRETRAINED MODEL: " << std::endl;
79+
80+
std::cout << "Waiting for torchvision to provide support for c++ and skip JIT" << std::endl;
8181

82-
// =============================================================== //
83-
// PRETRAINED MODEL //
84-
// =============================================================== //
8582

8683
// =============================================================== //
8784
// SAVE AND LOAD THE MODEL //
8885
// =============================================================== //
86+
87+
88+
std::cout << std::endl << "SAVE AND LOAD THE MODEL: " << std::endl;
89+
90+
std::cout << "Will be done after above process finishes" << std::endl;
8991
}

0 commit comments

Comments
 (0)